@graphql-markdown/core 1.20.0 → 1.21.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 (47) hide show
  1. package/dist/config.d.ts +9 -57
  2. package/dist/config.d.ts.map +1 -1
  3. package/dist/config.js +20 -60
  4. package/dist/const/patterns.d.ts.map +1 -1
  5. package/dist/diff.d.ts.map +1 -1
  6. package/dist/directives/normalize.d.ts +2 -2
  7. package/dist/directives/normalize.d.ts.map +1 -1
  8. package/dist/directives/validation.d.ts.map +1 -1
  9. package/dist/event-emitter.d.ts.map +1 -1
  10. package/dist/event-handlers.d.ts.map +1 -1
  11. package/dist/event-map.d.ts +1 -0
  12. package/dist/event-map.d.ts.map +1 -1
  13. package/dist/event-map.js +2 -0
  14. package/dist/events/diff-events.d.ts.map +1 -1
  15. package/dist/events/generate-index-metafile-events.d.ts.map +1 -1
  16. package/dist/events/index.d.ts +2 -1
  17. package/dist/events/index.d.ts.map +1 -1
  18. package/dist/events/index.js +21 -14
  19. package/dist/events/print-type-events.d.ts.map +1 -1
  20. package/dist/events/render-files-events.d.ts +13 -0
  21. package/dist/events/render-files-events.d.ts.map +1 -0
  22. package/dist/events/render-files-events.js +15 -0
  23. package/dist/events/render-files.d.ts +26 -0
  24. package/dist/events/render-files.d.ts.map +1 -0
  25. package/dist/events/render-files.js +20 -0
  26. package/dist/events/render-homepage-events.d.ts.map +1 -1
  27. package/dist/events/render-root-types-events.d.ts.map +1 -1
  28. package/dist/events/render-type-entities-events.d.ts.map +1 -1
  29. package/dist/events/render-type-entities.d.ts +4 -0
  30. package/dist/events/render-type-entities.d.ts.map +1 -1
  31. package/dist/events/schema-events.d.ts.map +1 -1
  32. package/dist/generator.d.ts +3 -14
  33. package/dist/generator.d.ts.map +1 -1
  34. package/dist/generator.js +15 -10
  35. package/dist/graphql-config.d.ts +0 -5
  36. package/dist/graphql-config.d.ts.map +1 -1
  37. package/dist/graphql-config.js +7 -4
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +13 -13
  41. package/dist/printer.d.ts +9 -10
  42. package/dist/printer.d.ts.map +1 -1
  43. package/dist/printer.js +11 -20
  44. package/dist/renderer.d.ts +4 -4
  45. package/dist/renderer.d.ts.map +1 -1
  46. package/dist/renderer.js +4 -4
  47. package/package.json +8 -11
package/dist/config.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  *
16
16
  * @packageDocumentation
17
17
  */
18
- import type { CliOptions, ConfigDocOptions, ConfigOptions, ConfigPrintTypeOptions, CustomDirective, DeprecatedCliOptions, DeprecatedConfigDocOptions, DeprecatedConfigPrintTypeOptions, DirectiveName, GroupByDirectiveOptions, Maybe, Options, TypeDiffMethod, TypeHierarchyObjectType, TypeHierarchyType, TypeHierarchyValueType } from "@graphql-markdown/types";
18
+ import type { CliOptions, ConfigDocOptions, ConfigOptions, ConfigPrintTypeOptions, CustomDirective, DirectiveName, GroupByDirectiveOptions, Maybe, Options, TypeDiffMethod, TypeHierarchyObjectType, TypeHierarchyType, TypeHierarchyValueType } from "@graphql-markdown/types";
19
19
  /**
20
20
  * Type hierarchy options for organizing schema documentation.
21
21
  *
@@ -97,8 +97,9 @@ export declare const DEFAULT_HIERARCHY: {
97
97
  * @public
98
98
  * @see {@link Options} for the complete configuration interface
99
99
  */
100
- export declare const DEFAULT_OPTIONS: Readonly<Pick<ConfigOptions, "customDirective" | "groupByDirective" | "loaders"> & Required<Omit<ConfigOptions, "customDirective" | "groupByDirective" | "loaders" | "mdxParser" | "printTypeOptions">>> & {
101
- printTypeOptions: Required<Omit<ConfigPrintTypeOptions, "hierarchy">> & {
100
+ export declare const DEFAULT_OPTIONS: Readonly<Pick<ConfigOptions, "customDirective" | "groupByDirective" | "loaders"> & Required<Omit<ConfigOptions, "customDirective" | "formatter" | "groupByDirective" | "loaders" | "mdxParser" | "printTypeOptions">>> & {
101
+ printTypeOptions: Required<Omit<ConfigPrintTypeOptions, "exampleSection" | "hierarchy">> & {
102
+ exampleSection: ConfigPrintTypeOptions["exampleSection"];
102
103
  hierarchy: Required<Pick<TypeHierarchyObjectType, TypeHierarchy.API>>;
103
104
  };
104
105
  };
@@ -233,17 +234,8 @@ export declare const getCustomDirectives: (customDirectiveOptions: Maybe<CustomD
233
234
  * @see {@link DiffMethod} for available diff methods
234
235
  */
235
236
  export declare const getForcedDiffMethod: () => TypeDiffMethod;
236
- export declare const getNormalizedDiffMethod: (diff: TypeDiffMethod) => TypeDiffMethod;
237
237
  export declare const getDiffMethod: (diff: TypeDiffMethod) => TypeDiffMethod;
238
- /**
239
- * Placeholder function for handling deprecated document options.
240
- * Currently returns an empty object as these options are deprecated.
241
- *
242
- * @param _cliOpts - Deprecated CLI options (unused)
243
- * @param _configOptions - Deprecated config options (unused)
244
- * @returns An empty object
245
- */
246
- export declare const parseDeprecatedDocOptions: (_cliOpts: Maybe<Omit<DeprecatedCliOptions, "never">>, _configOptions: Maybe<Omit<DeprecatedConfigDocOptions, "never">>) => Record<string, never>;
238
+ export declare const parseDeprecatedDocOptions: (_cliOpts?: Maybe<CliOptions>, _configOptions?: Maybe<ConfigDocOptions>) => Record<string, never>;
247
239
  /**
248
240
  * Builds the document options by merging CLI options, config file options, and defaults.
249
241
  * Handles index generation flag and front matter configuration.
@@ -264,7 +256,7 @@ export declare const parseDeprecatedDocOptions: (_cliOpts: Maybe<Omit<Deprecated
264
256
  * // }
265
257
  * ```
266
258
  */
267
- export declare const getDocOptions: (cliOpts?: Maybe<CliOptions & Omit<DeprecatedCliOptions, "never">>, configOptions?: Maybe<ConfigDocOptions & Omit<DeprecatedConfigDocOptions, "never">>) => Required<ConfigDocOptions>;
259
+ export declare const getDocOptions: (cliOpts?: Maybe<CliOptions>, configOptions?: Maybe<ConfigDocOptions>) => Required<ConfigDocOptions>;
268
260
  /**
269
261
  * Resolves the type hierarchy configuration by merging CLI and config file options.
270
262
  * Validates that CLI and config don't specify conflicting hierarchy types.
@@ -289,49 +281,9 @@ export declare const getDocOptions: (cliOpts?: Maybe<CliOptions & Omit<Deprecate
289
281
  * ```
290
282
  * @see {@link TypeHierarchy} for available hierarchy types
291
283
  */
292
- export declare const getTypeHierarchyOption: (cliOption?: Maybe<TypeHierarchyValueType>, configOption?: Maybe<TypeHierarchyType>) => Maybe<Partial<Record<TypeHierarchyValueType, import("@graphql-markdown/types").TypeHierarchyTypeOptions>>>;
293
- /**
294
- * Handles deprecated print type options.
295
- *
296
- * Emits deprecation warnings when legacy section toggle options are detected
297
- * from CLI flags or config file values.
298
- *
299
- * @param cliOpts - CLI options containing deprecated print type flags
300
- * @param configOptions - Config options containing deprecated print type settings
301
- * @returns An empty object reserved for backward compatibility
302
- */
303
- export declare const parseDeprecatedPrintTypeOptions: (cliOpts: Maybe<Pick<CliOptions, "noCode" | "noExample" | "noRelatedType">>, configOptions: Maybe<Pick<ConfigPrintTypeOptions, "codeSection" | "exampleSection" | "relatedTypeSection">>) => Record<string, never>;
304
- /**
305
- * Builds the print type options by merging CLI options, config file options, and defaults.
306
- * Handles various formatting options for type documentation.
307
- *
308
- * @param cliOpts - CLI options for print type configuration
309
- * @param configOptions - Config file options for print type configuration
310
- * @returns The resolved print type options with all required fields
311
- * @example
312
- * ```typescript
313
- * const cliOptions = { noCode: true, deprecated: "group" };
314
- * const configOptions = {
315
- * exampleSection: true,
316
- * hierarchy: "entity"
317
- * };
318
- *
319
- * const printOptions = getPrintTypeOptions(cliOptions, configOptions);
320
- * console.log(printOptions);
321
- * // {
322
- * // codeSection: false, // Disabled via noCode CLI flag
323
- * // deprecated: "group", // From CLI
324
- * // exampleSection: true, // From config
325
- * // parentTypePrefix: true, // Default value
326
- * // relatedTypeSection: true, // Default value
327
- * // typeBadges: true, // Default value
328
- * // hierarchy: { entity: {} } // Parsed from config
329
- * // }
330
- * ```
331
- * @see {@link DeprecatedOption} for deprecated handling options
332
- * @see {@link getTypeHierarchyOption} for hierarchy resolution
333
- */
334
- export declare const getPrintTypeOptions: (cliOpts: Maybe<CliOptions & Omit<DeprecatedCliOptions, "never">>, configOptions: Maybe<ConfigPrintTypeOptions & Omit<DeprecatedConfigPrintTypeOptions, "never">>) => Required<ConfigPrintTypeOptions>;
284
+ export declare const getTypeHierarchyOption: (cliOption?: Maybe<TypeHierarchyValueType>, configOption?: Maybe<TypeHierarchyType>) => Maybe<TypeHierarchyObjectType>;
285
+ export declare const parseDeprecatedFormatterOption: (cliOpts?: Maybe<CliOptions>, configOptions?: Maybe<ConfigOptions>) => Maybe<string>;
286
+ export declare const parseDeprecatedPrintTypeOptions: (_cliOpts?: Maybe<CliOptions>, _configOptions?: Maybe<ConfigPrintTypeOptions>) => Record<string, never>;
335
287
  /**
336
288
  * Parses and validates the groupByDirective option string format.
337
289
  * The format should be \@directive(field|=fallback) where:
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,gCAAgC,EAChC,aAAa,EAEb,uBAAuB,EACvB,KAAK,EACL,OAAO,EAIP,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAQjC;;;;;;;;;;;;GAYG;AACH,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED;;;;;;;;;;;GAWG;AACH,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;GAYG;AACH,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,qCAA+C,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,YAAY,gCAA0C,C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AG,KAAK,CAAC,kBAClB,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,KACpC,KAAK,CAAC,MAAM,CAcd,CAAC;AAmDF,eAAO,MAAM,WAAW,mBACN,KAAK,CAAC,aAAa,CAAC,YAC1B,KAAK,CAAC,UAAU,CAAC,OACvB,KAAK,CAAC,MAAM,CAAC,KAChB,OAAO,CAAC,OAAO,CAkFjB,CAAC"}
package/dist/config.js CHANGED
@@ -17,15 +17,15 @@
17
17
  * @packageDocumentation
18
18
  */
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.buildConfig = exports.parseHomepageOption = exports.parseGroupByOption = exports.getPrintTypeOptions = exports.parseDeprecatedPrintTypeOptions = exports.getTypeHierarchyOption = exports.getDocOptions = exports.parseDeprecatedDocOptions = exports.getDiffMethod = exports.getNormalizedDiffMethod = exports.getForcedDiffMethod = exports.getCustomDirectives = exports.getVisibilityDirectives = exports.getSkipDocDirectives = exports.getOnlyDocDirectives = exports.getDocDirective = exports.DEFAULT_OPTIONS = exports.DEFAULT_HIERARCHY = exports.ASSET_HOMEPAGE_LOCATION = exports.PACKAGE_NAME = exports.DOCS_URL = exports.DeprecatedOption = exports.DiffMethod = exports.TypeHierarchy = void 0;
20
+ exports.buildConfig = exports.parseHomepageOption = exports.parseGroupByOption = exports.parseDeprecatedPrintTypeOptions = exports.parseDeprecatedFormatterOption = exports.getTypeHierarchyOption = exports.getDocOptions = exports.parseDeprecatedDocOptions = exports.getDiffMethod = exports.getForcedDiffMethod = exports.getCustomDirectives = exports.getVisibilityDirectives = exports.getSkipDocDirectives = exports.getOnlyDocDirectives = exports.getDocDirective = exports.DEFAULT_OPTIONS = exports.DEFAULT_HIERARCHY = exports.ASSET_HOMEPAGE_LOCATION = exports.PACKAGE_NAME = exports.DOCS_URL = exports.DeprecatedOption = exports.DiffMethod = exports.TypeHierarchy = void 0;
21
21
  const node_path_1 = require("node:path");
22
22
  const node_os_1 = require("node:os");
23
23
  const deepmerge_1 = require("@fastify/deepmerge");
24
+ const logger_1 = require("@graphql-markdown/logger");
24
25
  const graphql_config_1 = require("./graphql-config");
25
26
  const patterns_1 = require("./const/patterns");
26
27
  const validation_1 = require("./directives/validation");
27
28
  const builder_1 = require("./options/builder");
28
- const logger_1 = require("@graphql-markdown/logger");
29
29
  /**
30
30
  * Type hierarchy options for organizing schema documentation.
31
31
  *
@@ -126,13 +126,10 @@ exports.DEFAULT_OPTIONS = {
126
126
  loaders: undefined,
127
127
  metatags: [],
128
128
  pretty: false,
129
- printer: "@graphql-markdown/printer-legacy",
130
129
  printTypeOptions: {
131
- codeSection: true,
132
130
  deprecated: DeprecatedOption.DEFAULT,
133
- exampleSection: false,
131
+ exampleSection: undefined,
134
132
  parentTypePrefix: true,
135
- relatedTypeSection: true,
136
133
  typeBadges: true,
137
134
  },
138
135
  rootPath: "./docs",
@@ -331,19 +328,10 @@ exports.getForcedDiffMethod = getForcedDiffMethod;
331
328
  const getNormalizedDiffMethod = (diff) => {
332
329
  return diff.toLocaleUpperCase();
333
330
  };
334
- exports.getNormalizedDiffMethod = getNormalizedDiffMethod;
335
331
  const getDiffMethod = (diff) => {
336
- return (0, exports.getNormalizedDiffMethod)(diff);
332
+ return getNormalizedDiffMethod(diff);
337
333
  };
338
334
  exports.getDiffMethod = getDiffMethod;
339
- /**
340
- * Placeholder function for handling deprecated document options.
341
- * Currently returns an empty object as these options are deprecated.
342
- *
343
- * @param _cliOpts - Deprecated CLI options (unused)
344
- * @param _configOptions - Deprecated config options (unused)
345
- * @returns An empty object
346
- */
347
335
  const parseDeprecatedDocOptions = (_cliOpts, _configOptions) => {
348
336
  return {};
349
337
  };
@@ -443,35 +431,17 @@ const getTypeHierarchyOption = (cliOption, configOption) => {
443
431
  return cliHierarchy ?? configHierarchy ?? exports.DEFAULT_HIERARCHY;
444
432
  };
445
433
  exports.getTypeHierarchyOption = getTypeHierarchyOption;
446
- /**
447
- * Handles deprecated print type options.
448
- *
449
- * Emits deprecation warnings when legacy section toggle options are detected
450
- * from CLI flags or config file values.
451
- *
452
- * @param cliOpts - CLI options containing deprecated print type flags
453
- * @param configOptions - Config options containing deprecated print type settings
454
- * @returns An empty object reserved for backward compatibility
455
- */
456
- const parseDeprecatedPrintTypeOptions = (cliOpts, configOptions) => {
457
- if (cliOpts?.noCode) {
458
- (0, logger_1.log)(`[DEPRECATED] CLI option '--noCode' is deprecated. Use the 'beforeComposePageTypeHook' event instead: remove 'code' from event.output to hide the code section.`, logger_1.LogLevel.warn);
459
- }
460
- else if (typeof configOptions?.codeSection === "boolean") {
461
- (0, logger_1.log)(`[DEPRECATED] config option 'printTypeOptions.codeSection' is deprecated. Use the 'beforeComposePageTypeHook' event instead: remove 'code' from event.output to hide the code section.`, logger_1.LogLevel.warn);
462
- }
463
- if (cliOpts?.noExample) {
464
- (0, logger_1.log)(`[DEPRECATED] CLI option '--noExample' is deprecated. Use the 'beforeComposePageTypeHook' event instead: remove 'example' from event.output to hide the example section.`, logger_1.LogLevel.warn);
465
- }
466
- else if (typeof configOptions?.exampleSection === "boolean") {
467
- (0, logger_1.log)(`[DEPRECATED] config option 'printTypeOptions.exampleSection' is deprecated. Use the 'beforeComposePageTypeHook' event instead: remove 'example' from event.output to hide the example section.`, logger_1.LogLevel.warn);
468
- }
469
- if (cliOpts?.noRelatedType) {
470
- (0, logger_1.log)(`[DEPRECATED] CLI option '--noRelatedType' is deprecated. Use the 'beforeComposePageTypeHook' event instead: remove 'relations' from event.output to hide the relations section.`, logger_1.LogLevel.warn);
471
- }
472
- else if (typeof configOptions?.relatedTypeSection === "boolean") {
473
- (0, logger_1.log)(`[DEPRECATED] config option 'printTypeOptions.relatedTypeSection' is deprecated. Use the 'beforeComposePageTypeHook' event instead: remove 'relations' from event.output to hide the relations section.`, logger_1.LogLevel.warn);
434
+ const parseDeprecatedFormatterOption = (cliOpts, configOptions) => {
435
+ const legacyCli = cliOpts?.mdxParser ?? null; // NOSONAR typescript:S1874
436
+ const legacyConfig = configOptions?.mdxParser; // NOSONAR typescript:S1874
437
+ if (legacyCli !== null ||
438
+ (legacyConfig !== undefined && legacyConfig !== null)) {
439
+ (0, logger_1.log)(`Setting "mdxParser" is deprecated and will be removed in a future version. Use "formatter" instead.`, logger_1.LogLevel.warn);
474
440
  }
441
+ return (cliOpts?.formatter ?? legacyCli ?? configOptions?.formatter ?? legacyConfig);
442
+ };
443
+ exports.parseDeprecatedFormatterOption = parseDeprecatedFormatterOption;
444
+ const parseDeprecatedPrintTypeOptions = (_cliOpts, _configOptions) => {
475
445
  return {};
476
446
  };
477
447
  exports.parseDeprecatedPrintTypeOptions = parseDeprecatedPrintTypeOptions;
@@ -484,20 +454,18 @@ exports.parseDeprecatedPrintTypeOptions = parseDeprecatedPrintTypeOptions;
484
454
  * @returns The resolved print type options with all required fields
485
455
  * @example
486
456
  * ```typescript
487
- * const cliOptions = { noCode: true, deprecated: "group" };
457
+ * const cliOptions = { deprecated: "group" };
488
458
  * const configOptions = {
489
- * exampleSection: true,
459
+ * exampleSection: { directive: "example" },
490
460
  * hierarchy: "entity"
491
461
  * };
492
462
  *
493
463
  * const printOptions = getPrintTypeOptions(cliOptions, configOptions);
494
464
  * console.log(printOptions);
495
465
  * // {
496
- * // codeSection: false, // Disabled via noCode CLI flag
497
466
  * // deprecated: "group", // From CLI
498
- * // exampleSection: true, // From config
467
+ * // exampleSection: { directive: "example" }, // From config
499
468
  * // parentTypePrefix: true, // Default value
500
- * // relatedTypeSection: true, // Default value
501
469
  * // typeBadges: true, // Default value
502
470
  * // hierarchy: { entity: {} } // Parsed from config
503
471
  * // }
@@ -507,23 +475,18 @@ exports.parseDeprecatedPrintTypeOptions = parseDeprecatedPrintTypeOptions;
507
475
  */
508
476
  const getPrintTypeOptions = (cliOpts, configOptions) => {
509
477
  return {
510
- codeSection: (!cliOpts?.noCode && configOptions?.codeSection) ??
511
- exports.DEFAULT_OPTIONS.printTypeOptions.codeSection,
512
478
  deprecated: (cliOpts?.deprecated ??
513
479
  configOptions?.deprecated ??
514
480
  exports.DEFAULT_OPTIONS.printTypeOptions.deprecated).toLocaleLowerCase(),
515
- exampleSection: (!cliOpts?.noExample && configOptions?.exampleSection) ??
481
+ exampleSection: configOptions?.exampleSection ??
516
482
  exports.DEFAULT_OPTIONS.printTypeOptions.exampleSection,
517
483
  parentTypePrefix: (!cliOpts?.noParentType && configOptions?.parentTypePrefix) ??
518
484
  exports.DEFAULT_OPTIONS.printTypeOptions.parentTypePrefix,
519
- relatedTypeSection: (!cliOpts?.noRelatedType && configOptions?.relatedTypeSection) ??
520
- exports.DEFAULT_OPTIONS.printTypeOptions.relatedTypeSection,
521
485
  typeBadges: (!cliOpts?.noTypeBadges && configOptions?.typeBadges) ??
522
486
  exports.DEFAULT_OPTIONS.printTypeOptions.typeBadges,
523
487
  hierarchy: (0, exports.getTypeHierarchyOption)(cliOpts?.hierarchy, configOptions?.hierarchy),
524
488
  };
525
489
  };
526
- exports.getPrintTypeOptions = getPrintTypeOptions;
527
490
  /**
528
491
  * Parses and validates the groupByDirective option string format.
529
492
  * The format should be \@directive(field|=fallback) where:
@@ -582,8 +545,6 @@ exports.parseHomepageOption = parseHomepageOption;
582
545
  const buildConfig = async (configFileOpts, cliOpts, id = "default") => {
583
546
  cliOpts ??= {};
584
547
  const graphqlConfig = await (0, graphql_config_1.loadConfiguration)(id);
585
- // Emit deprecation warnings using raw user-provided options only (no defaults merged in),
586
- // so we don't spuriously warn for projects that never set these options.
587
548
  (0, exports.parseDeprecatedPrintTypeOptions)(cliOpts, {
588
549
  ...graphqlConfig?.printTypeOptions,
589
550
  ...configFileOpts?.printTypeOptions,
@@ -629,13 +590,12 @@ const buildConfig = async (configFileOpts, cliOpts, id = "default") => {
629
590
  id: id ?? exports.DEFAULT_OPTIONS.id,
630
591
  linkRoot,
631
592
  loaders: config.loaders,
632
- mdxParser: cliOpts.mdxParser ?? config.mdxParser,
593
+ formatter: (0, exports.parseDeprecatedFormatterOption)(cliOpts, config),
633
594
  metatags: config.metatags ?? exports.DEFAULT_OPTIONS.metatags,
634
595
  onlyDocDirective,
635
596
  outputDir: (0, node_path_1.join)(rootPath, baseURL),
636
597
  prettify,
637
- printer: (config.printer ?? exports.DEFAULT_OPTIONS.printer),
638
- printTypeOptions: (0, exports.getPrintTypeOptions)(cliOpts, config.printTypeOptions),
598
+ printTypeOptions: getPrintTypeOptions(cliOpts, config.printTypeOptions),
639
599
  schemaLocation,
640
600
  skipDocDirective,
641
601
  tmpDir,
@@ -1 +1 @@
1
- {"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/const/patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;;;;;;OAUG;;IAGH;;;;;;;;;;OAUG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;;;;;OAaG;;CAEK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;;OAGG;;CAEK,CAAC"}
1
+ {"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/const/patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;;;;;;OAUG;aACH,cAAc;IAEd;;;;;;;;;;OAUG;aACH,kBAAkB;IAElB;;;;;;;;;OASG;aACH,aAAa;IAEb;;;;;;;;;OASG;aACH,eAAe;IAEf;;;;;;;;;OASG;aACH,uBAAuB;IAEvB;;;;;;;;;OASG;aACH,uBAAuB;IAEvB;;;;;;;;;;;;;OAaG;aACH,cAAc;CACN,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;;OAGG;aACH,aAAa,EAAE,eAAe;CACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../src/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EACb,KAAK,EACN,MAAM,yBAAyB,CAAC;AAIjC;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,UAAU,4HAwBtB,CAAC"}
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../src/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EACb,KAAK,EACN,MAAM,yBAAyB,CAAC;AAIjC;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,UAAU,WACb,aAAa,UACb,MAAM,cACF,KAAK,CAAC,cAAc,CAAC,eACrB,KAAK,CAAC,MAAM,CAAC,KACxB,OAAO,CAAC,OAAO,CAmBjB,CAAC"}
@@ -37,7 +37,7 @@ import type { DirectiveName, Maybe } from "@graphql-markdown/types";
37
37
  * // Result: ["@example", "@internal", "@auth"]
38
38
  * ```
39
39
  */
40
- export declare const normalizeDirectiveNames: (...sources: Maybe<DirectiveName[]>[]) => DirectiveName[];
40
+ export declare const normalizeDirectiveNames: (...sources: (DirectiveName[] | Maybe<DirectiveName[]>)[]) => DirectiveName[];
41
41
  /**
42
42
  * Removes duplicate directive names from an array while preserving order.
43
43
  *
@@ -75,5 +75,5 @@ export declare const uniqueDirectiveNames: (directives: DirectiveName[]) => Dire
75
75
  * // Result: ["@example", "@internal", "@auth"]
76
76
  * ```
77
77
  */
78
- export declare const combineDirectiveNames: (...sources: Maybe<DirectiveName[]>[]) => DirectiveName[];
78
+ export declare const combineDirectiveNames: (...sources: (DirectiveName[] | Maybe<DirectiveName[]>)[]) => DirectiveName[];
79
79
  //# sourceMappingURL=normalize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/directives/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,uBAAuB,2DAQnC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,kDAIhC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,qBAAqB,2DAIjC,CAAC"}
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/directives/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,uBAAuB,eACtB,CAAC,aAAa,EAAE,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,KACvD,aAAa,EAMf,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,eACnB,aAAa,EAAE,KAC1B,aAAa,EAEf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,qBAAqB,eACpB,CAAC,aAAa,EAAE,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,KACvD,aAAa,EAEf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/directives/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,sFAQzB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,+EAQlB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,uCAE1B,CAAC;AA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MAAM,cAAc,WAAY,OAAO,KAAG,MAAM,IAAI,MAE1D,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yBAAyB,WAC5B,OAAO,YACL,YAAY,GAAG,KAAK,KAC7B,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAMlC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../src/event-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,cAAM,uBAAwB,SAAQ,YAAY;IAChD,OAAO,CAAC,MAAM,CAAC,OAAO;IAItB,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAMjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,SAAS,CACb,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,UAAU,CAAC,CAgBrB;YAEa,cAAc;YAOd,eAAe;YAsBf,gBAAgB;CAgB/B;AAQD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS,+BAGrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,YAKvB,CAAC"}
1
+ {"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../src/event-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,cAAM,uBAAwB,SAAQ,YAAY;IAChD,OAAO,CAAC,MAAM,CAAC,OAAO;IAItB,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAMjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,SAAS,CACb,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,UAAU,CAAC,CAgBrB;YAEa,cAAc;YAOd,eAAe;YAsBf,gBAAgB;CAgB/B;AAQD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS,QAAO,uBAG5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,QAAO,IAK9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"event-handlers.d.ts","sourceRoot":"","sources":["../src/event-handlers.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,wBAAwB,8BAwCpC,CAAC"}
1
+ {"version":3,"file":"event-handlers.d.ts","sourceRoot":"","sources":["../src/event-handlers.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,wBAAwB,cAAe,OAAO,KAAG,IAwC7D,CAAC"}
@@ -18,6 +18,7 @@ export declare const EVENT_CALLBACK_MAP: {
18
18
  readonly "render:afterRenderTypeEntities": "afterRenderTypeEntitiesHook";
19
19
  readonly "render:beforeGenerateIndexMetafile": "beforeGenerateIndexMetafileHook";
20
20
  readonly "render:afterGenerateIndexMetafile": "afterGenerateIndexMetafileHook";
21
+ readonly "render:afterRenderFiles": "afterRenderFilesHook";
21
22
  readonly "print:beforePrintCode": "beforePrintCodeHook";
22
23
  readonly "print:afterPrintCode": "afterPrintCodeHook";
23
24
  readonly "print:beforePrintType": "beforePrintTypeHook";
@@ -1 +1 @@
1
- {"version":3,"file":"event-map.d.ts","sourceRoot":"","sources":["../src/event-map.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;CAoBrB,CAAC"}
1
+ {"version":3,"file":"event-map.d.ts","sourceRoot":"","sources":["../src/event-map.ts"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;kCACD,sBAAsB;iCACvB,qBAAqB;iCACrB,qBAAqB;gCACtB,oBAAoB;6CACP,2BAA2B;4CAC5B,0BAA0B;4CAC1B,0BAA0B;2CAC3B,yBAAyB;gDACpB,8BAA8B;+CAC/B,6BAA6B;mDAEpE,iCAAiC;kDAEjC,gCAAgC;wCACA,sBAAsB;sCACnB,qBAAqB;qCACtB,oBAAoB;sCACnB,qBAAqB;qCACtB,oBAAoB;4CACZ,2BAA2B;CAC/D,CAAC"}
package/dist/event-map.js CHANGED
@@ -15,6 +15,7 @@ const render_root_types_events_1 = require("./events/render-root-types-events");
15
15
  const render_homepage_events_1 = require("./events/render-homepage-events");
16
16
  const render_type_entities_events_1 = require("./events/render-type-entities-events");
17
17
  const generate_index_metafile_events_1 = require("./events/generate-index-metafile-events");
18
+ const render_files_events_1 = require("./events/render-files-events");
18
19
  const print_type_events_1 = require("./events/print-type-events");
19
20
  /**
20
21
  * Event callback mapping configuration.
@@ -36,6 +37,7 @@ exports.EVENT_CALLBACK_MAP = {
36
37
  [render_type_entities_events_1.RenderTypeEntitiesEvents.AFTER_RENDER]: "afterRenderTypeEntitiesHook",
37
38
  [generate_index_metafile_events_1.GenerateIndexMetafileEvents.BEFORE_GENERATE]: "beforeGenerateIndexMetafileHook",
38
39
  [generate_index_metafile_events_1.GenerateIndexMetafileEvents.AFTER_GENERATE]: "afterGenerateIndexMetafileHook",
40
+ [render_files_events_1.RenderFilesEvents.AFTER_RENDER]: "afterRenderFilesHook",
39
41
  [print_type_events_1.PrintTypeEvents.BEFORE_PRINT_CODE]: "beforePrintCodeHook",
40
42
  [print_type_events_1.PrintTypeEvents.AFTER_PRINT_CODE]: "afterPrintCodeHook",
41
43
  [print_type_events_1.PrintTypeEvents.BEFORE_PRINT_TYPE]: "beforePrintTypeHook",
@@ -1 +1 @@
1
- {"version":3,"file":"diff-events.d.ts","sourceRoot":"","sources":["../../src/events/diff-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;IACrB,iDAAiD;;IAEjD,gDAAgD;;CAExC,CAAC"}
1
+ {"version":3,"file":"diff-events.d.ts","sourceRoot":"","sources":["../../src/events/diff-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;IACrB,iDAAiD;aACjD,YAAY,EAAE,kBAAkB;IAChC,gDAAgD;aAChD,WAAW,EAAE,iBAAiB;CACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"generate-index-metafile-events.d.ts","sourceRoot":"","sources":["../../src/events/generate-index-metafile-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,2BAA2B;IACtC,+CAA+C;;IAE/C,8CAA8C;;CAEtC,CAAC"}
1
+ {"version":3,"file":"generate-index-metafile-events.d.ts","sourceRoot":"","sources":["../../src/events/generate-index-metafile-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,2BAA2B;IACtC,+CAA+C;aAC/C,eAAe,EAAE,oCAAoC;IACrD,8CAA8C;aAC9C,cAAc,EAAE,mCAAmC;CAC3C,CAAC"}
@@ -7,6 +7,7 @@ export { SchemaEvents } from "./schema-events";
7
7
  export { DiffEvents } from "./diff-events";
8
8
  export { RenderRootTypesEvents } from "./render-root-types-events";
9
9
  export { RenderHomepageEvents } from "./render-homepage-events";
10
+ export { RenderFilesEvents } from "./render-files-events";
10
11
  export { RenderTypeEntitiesEvents } from "./render-type-entities-events";
11
12
  export { GenerateIndexMetafileEvents } from "./generate-index-metafile-events";
12
13
  export { PrintTypeEvents } from "./print-type-events";
@@ -14,7 +15,7 @@ export { SchemaEvent } from "./schema-load";
14
15
  export { DiffCheckEvent } from "./diff-check";
15
16
  export { RenderRootTypesEvent } from "./render-root-types";
16
17
  export { RenderHomepageEvent } from "./render-homepage";
18
+ export { RenderFilesEvent } from "./render-files";
17
19
  export { RenderTypeEntitiesEvent } from "./render-type-entities";
18
20
  export { GenerateIndexMetafileEvent } from "./generate-index-metafile";
19
- export type { PrintCodeEventData, PrintTypeEventData, ComposePageTypeEventData, PageSection, PageSections, } from "@graphql-markdown/types";
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,WAAW,EACX,YAAY,GACb,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAI/E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
@@ -5,32 +5,39 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.GenerateIndexMetafileEvent = exports.RenderTypeEntitiesEvent = exports.RenderHomepageEvent = exports.RenderRootTypesEvent = exports.DiffCheckEvent = exports.SchemaEvent = exports.PrintTypeEvents = exports.GenerateIndexMetafileEvents = exports.RenderTypeEntitiesEvents = exports.RenderHomepageEvents = exports.RenderRootTypesEvents = exports.DiffEvents = exports.SchemaEvents = void 0;
8
+ exports.GenerateIndexMetafileEvent = exports.RenderTypeEntitiesEvent = exports.RenderFilesEvent = exports.RenderHomepageEvent = exports.RenderRootTypesEvent = exports.DiffCheckEvent = exports.SchemaEvent = exports.PrintTypeEvents = exports.GenerateIndexMetafileEvents = exports.RenderTypeEntitiesEvents = exports.RenderFilesEvents = exports.RenderHomepageEvents = exports.RenderRootTypesEvents = exports.DiffEvents = exports.SchemaEvents = void 0;
9
9
  // Event constants
10
- const schema_events_1 = require("./schema-events");
10
+ var schema_events_1 = require("./schema-events");
11
11
  Object.defineProperty(exports, "SchemaEvents", { enumerable: true, get: function () { return schema_events_1.SchemaEvents; } });
12
- const diff_events_1 = require("./diff-events");
12
+ var diff_events_1 = require("./diff-events");
13
13
  Object.defineProperty(exports, "DiffEvents", { enumerable: true, get: function () { return diff_events_1.DiffEvents; } });
14
- const render_root_types_events_1 = require("./render-root-types-events");
14
+ var render_root_types_events_1 = require("./render-root-types-events");
15
15
  Object.defineProperty(exports, "RenderRootTypesEvents", { enumerable: true, get: function () { return render_root_types_events_1.RenderRootTypesEvents; } });
16
- const render_homepage_events_1 = require("./render-homepage-events");
16
+ var render_homepage_events_1 = require("./render-homepage-events");
17
17
  Object.defineProperty(exports, "RenderHomepageEvents", { enumerable: true, get: function () { return render_homepage_events_1.RenderHomepageEvents; } });
18
- const render_type_entities_events_1 = require("./render-type-entities-events");
18
+ var render_files_events_1 = require("./render-files-events");
19
+ Object.defineProperty(exports, "RenderFilesEvents", { enumerable: true, get: function () { return render_files_events_1.RenderFilesEvents; } });
20
+ var render_type_entities_events_1 = require("./render-type-entities-events");
19
21
  Object.defineProperty(exports, "RenderTypeEntitiesEvents", { enumerable: true, get: function () { return render_type_entities_events_1.RenderTypeEntitiesEvents; } });
20
- const generate_index_metafile_events_1 = require("./generate-index-metafile-events");
22
+ var generate_index_metafile_events_1 = require("./generate-index-metafile-events");
21
23
  Object.defineProperty(exports, "GenerateIndexMetafileEvents", { enumerable: true, get: function () { return generate_index_metafile_events_1.GenerateIndexMetafileEvents; } });
22
- const print_type_events_1 = require("./print-type-events");
24
+ // Needed by tests/unit/events.test.ts; core/index.ts re-exports this directly
25
+ // from source, making the barrel entry appear unused in production mode.
26
+ // fallow-ignore-next-line unused-export
27
+ var print_type_events_1 = require("./print-type-events");
23
28
  Object.defineProperty(exports, "PrintTypeEvents", { enumerable: true, get: function () { return print_type_events_1.PrintTypeEvents; } });
24
29
  // Event classes
25
- const schema_load_1 = require("./schema-load");
30
+ var schema_load_1 = require("./schema-load");
26
31
  Object.defineProperty(exports, "SchemaEvent", { enumerable: true, get: function () { return schema_load_1.SchemaEvent; } });
27
- const diff_check_1 = require("./diff-check");
32
+ var diff_check_1 = require("./diff-check");
28
33
  Object.defineProperty(exports, "DiffCheckEvent", { enumerable: true, get: function () { return diff_check_1.DiffCheckEvent; } });
29
- const render_root_types_1 = require("./render-root-types");
34
+ var render_root_types_1 = require("./render-root-types");
30
35
  Object.defineProperty(exports, "RenderRootTypesEvent", { enumerable: true, get: function () { return render_root_types_1.RenderRootTypesEvent; } });
31
- const render_homepage_1 = require("./render-homepage");
36
+ var render_homepage_1 = require("./render-homepage");
32
37
  Object.defineProperty(exports, "RenderHomepageEvent", { enumerable: true, get: function () { return render_homepage_1.RenderHomepageEvent; } });
33
- const render_type_entities_1 = require("./render-type-entities");
38
+ var render_files_1 = require("./render-files");
39
+ Object.defineProperty(exports, "RenderFilesEvent", { enumerable: true, get: function () { return render_files_1.RenderFilesEvent; } });
40
+ var render_type_entities_1 = require("./render-type-entities");
34
41
  Object.defineProperty(exports, "RenderTypeEntitiesEvent", { enumerable: true, get: function () { return render_type_entities_1.RenderTypeEntitiesEvent; } });
35
- const generate_index_metafile_1 = require("./generate-index-metafile");
42
+ var generate_index_metafile_1 = require("./generate-index-metafile");
36
43
  Object.defineProperty(exports, "GenerateIndexMetafileEvent", { enumerable: true, get: function () { return generate_index_metafile_1.GenerateIndexMetafileEvent; } });
@@ -1 +1 @@
1
- {"version":3,"file":"print-type-events.d.ts","sourceRoot":"","sources":["../../src/events/print-type-events.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe;IAC1B,0DAA0D;;IAE1D,kFAAkF;;IAElF,4DAA4D;;IAE5D,oFAAoF;;IAEpF,0EAA0E;;CAElE,CAAC"}
1
+ {"version":3,"file":"print-type-events.d.ts","sourceRoot":"","sources":["../../src/events/print-type-events.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe;IAC1B,0DAA0D;aAC1D,iBAAiB,EAAE,uBAAuB;IAC1C,kFAAkF;aAClF,gBAAgB,EAAE,sBAAsB;IACxC,4DAA4D;aAC5D,iBAAiB,EAAE,uBAAuB;IAC1C,oFAAoF;aACpF,gBAAgB,EAAE,sBAAsB;IACxC,0EAA0E;aAC1E,wBAAwB,EAAE,6BAA6B;CAC/C,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Render files event constants.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ /**
7
+ * Event names fired once after all output files (entities + homepage) are written.
8
+ */
9
+ export declare const RenderFilesEvents: {
10
+ /** Emitted after all files have been written */
11
+ readonly AFTER_RENDER: "render:afterRenderFiles";
12
+ };
13
+ //# sourceMappingURL=render-files-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-files-events.d.ts","sourceRoot":"","sources":["../../src/events/render-files-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B,gDAAgD;aAChD,YAAY,EAAE,yBAAyB;CAC/B,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * Render files event constants.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.RenderFilesEvents = void 0;
9
+ /**
10
+ * Event names fired once after all output files (entities + homepage) are written.
11
+ */
12
+ exports.RenderFilesEvents = {
13
+ /** Emitted after all files have been written */
14
+ AFTER_RENDER: "render:afterRenderFiles",
15
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Render files event class.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import type { CancellableEventOptions } from "@graphql-markdown/utils";
7
+ import { DataEvent } from "@graphql-markdown/utils";
8
+ /**
9
+ * Event emitted after all output files (entities + homepage) have been written.
10
+ *
11
+ * @category Events
12
+ */
13
+ export declare class RenderFilesEvent extends DataEvent<{
14
+ baseURL: string;
15
+ outputDir: string;
16
+ rootDir: string;
17
+ pages: unknown;
18
+ }> {
19
+ constructor(data: {
20
+ baseURL: string;
21
+ outputDir: string;
22
+ rootDir: string;
23
+ pages: unknown;
24
+ }, options?: CancellableEventOptions);
25
+ }
26
+ //# sourceMappingURL=render-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-files.d.ts","sourceRoot":"","sources":["../../src/events/render-files.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,SAAS,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;IACA,YACE,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,OAAO,CAAC;KAChB,EACD,OAAO,CAAC,EAAE,uBAAuB,EAGlC;CACF"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /**
3
+ * Render files event class.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.RenderFilesEvent = void 0;
9
+ const utils_1 = require("@graphql-markdown/utils");
10
+ /**
11
+ * Event emitted after all output files (entities + homepage) have been written.
12
+ *
13
+ * @category Events
14
+ */
15
+ class RenderFilesEvent extends utils_1.DataEvent {
16
+ constructor(data, options) {
17
+ super(data, options);
18
+ }
19
+ }
20
+ exports.RenderFilesEvent = RenderFilesEvent;
@@ -1 +1 @@
1
- {"version":3,"file":"render-homepage-events.d.ts","sourceRoot":"","sources":["../../src/events/render-homepage-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;IAC/B,wCAAwC;;IAExC,uCAAuC;;CAE/B,CAAC"}
1
+ {"version":3,"file":"render-homepage-events.d.ts","sourceRoot":"","sources":["../../src/events/render-homepage-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;IAC/B,wCAAwC;aACxC,aAAa,EAAE,6BAA6B;IAC5C,uCAAuC;aACvC,YAAY,EAAE,4BAA4B;CAClC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"render-root-types-events.d.ts","sourceRoot":"","sources":["../../src/events/render-root-types-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;IAChC,0CAA0C;;IAE1C,yCAAyC;;CAEjC,CAAC"}
1
+ {"version":3,"file":"render-root-types-events.d.ts","sourceRoot":"","sources":["../../src/events/render-root-types-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;IAChC,0CAA0C;aAC1C,aAAa,EAAE,8BAA8B;IAC7C,yCAAyC;aACzC,YAAY,EAAE,6BAA6B;CACnC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"render-type-entities-events.d.ts","sourceRoot":"","sources":["../../src/events/render-type-entities-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;IACnC,6CAA6C;;IAE7C,4CAA4C;;CAEpC,CAAC"}
1
+ {"version":3,"file":"render-type-entities-events.d.ts","sourceRoot":"","sources":["../../src/events/render-type-entities-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;IACnC,6CAA6C;aAC7C,aAAa,EAAE,iCAAiC;IAChD,4CAA4C;aAC5C,YAAY,EAAE,gCAAgC;CACtC,CAAC"}
@@ -11,12 +11,16 @@ import { DataEvent } from "@graphql-markdown/utils";
11
11
  * @category Events
12
12
  */
13
13
  export declare class RenderTypeEntitiesEvent extends DataEvent<{
14
+ baseURL: string;
14
15
  name: string;
15
16
  filePath: string;
17
+ outputDir: string;
16
18
  }> {
17
19
  constructor(data: {
20
+ baseURL: string;
18
21
  name: string;
19
22
  filePath: string;
23
+ outputDir: string;
20
24
  }, options?: CancellableEventOptions);
21
25
  }
22
26
  //# sourceMappingURL=render-type-entities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-type-entities.d.ts","sourceRoot":"","sources":["../../src/events/render-type-entities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,SAAS,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;IACA,YACE,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,EACD,OAAO,CAAC,EAAE,uBAAuB,EAGlC;CACF"}
1
+ {"version":3,"file":"render-type-entities.d.ts","sourceRoot":"","sources":["../../src/events/render-type-entities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,SAAS,CAAC;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;IACA,YACE,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,EACD,OAAO,CAAC,EAAE,uBAAuB,EAGlC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema-events.d.ts","sourceRoot":"","sources":["../../src/events/schema-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB,4CAA4C;;IAE5C,2CAA2C;;IAE3C,4CAA4C;;IAE5C,2CAA2C;;CAEnC,CAAC"}
1
+ {"version":3,"file":"schema-events.d.ts","sourceRoot":"","sources":["../../src/events/schema-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB,4CAA4C;aAC5C,WAAW,EAAE,mBAAmB;IAChC,2CAA2C;aAC3C,UAAU,EAAE,kBAAkB;IAC9B,4CAA4C;aAC5C,UAAU,EAAE,kBAAkB;IAC9B,2CAA2C;aAC3C,SAAS,EAAE,iBAAiB;CACpB,CAAC"}
@@ -8,17 +8,6 @@
8
8
  * @packageDocumentation
9
9
  */
10
10
  import type { DirectiveName, Formatter, GeneratorOptions, GraphQLDirective, GraphQLSchema, LoaderOption, Maybe, MetaInfo, PackageName, TypeDiffMethod } from "@graphql-markdown/types";
11
- /**
12
- * Supported file extensions for generated documentation files.
13
- *
14
- * @remarks
15
- * - MDX: MDX file extension (.mdx) for React component-enabled markdown
16
- * - MD: Standard markdown file extension (.md)
17
- */
18
- export declare const FILE_EXTENSION: {
19
- readonly MDX: ".mdx";
20
- readonly MD: ".md";
21
- };
22
11
  /**
23
12
  * Asynchronously loads an MDX module dynamically.
24
13
  *
@@ -29,7 +18,7 @@ export declare const FILE_EXTENSION: {
29
18
  *
30
19
  * @internal
31
20
  */
32
- export declare const loadMDXModule: (mdxParser: Maybe<string | PackageName>) => Promise<unknown>;
21
+ export declare const loadMDXModule: (mdxParser: Maybe<PackageName | string>) => Promise<unknown>;
33
22
  /**
34
23
  * Gets a property from an MDX module, checking both the module directly and `module.default`.
35
24
  *
@@ -97,7 +86,7 @@ export declare const checkSchemaDifferences: (schema: GraphQLSchema, schemaLocat
97
86
  * @returns A tuple containing two arrays: the first with resolved "only" directives,
98
87
  * the second with resolved "skip" directives. Only defined directives are included.
99
88
  */
100
- export declare const resolveSkipAndOnlyDirectives: (onlyDocDirective: Maybe<DirectiveName[] | DirectiveName>, skipDocDirective: Maybe<DirectiveName[] | DirectiveName>, schema: GraphQLSchema) => GraphQLDirective[][];
89
+ export declare const resolveSkipAndOnlyDirectives: (onlyDocDirective: Maybe<DirectiveName | DirectiveName[]>, skipDocDirective: Maybe<DirectiveName | DirectiveName[]>, schema: GraphQLSchema) => GraphQLDirective[][];
101
90
  /**
102
91
  * Main entry point for generating Markdown documentation from a GraphQL schema.
103
92
  *
@@ -111,5 +100,5 @@ export declare const resolveSkipAndOnlyDirectives: (onlyDocDirective: Maybe<Dire
111
100
  * @param options - Complete configuration for the documentation generation
112
101
  * @returns Promise that resolves when documentation is fully generated
113
102
  */
114
- export declare const generateDocFromSchema: ({ baseURL, customDirective, diffMethod, docOptions, force, groupByDirective, homepageLocation, linkRoot, loaders: loadersList, loggerModule, mdxParser, metatags, onlyDocDirective, outputDir, prettify, printer: printerModule, printTypeOptions, schemaLocation, skipDocDirective, tmpDir, }: GeneratorOptions) => Promise<void>;
103
+ export declare const generateDocFromSchema: ({ baseURL, customDirective, diffMethod, docOptions, force, groupByDirective, homepageLocation, linkRoot, loaders: loadersList, loggerModule, formatter, metatags, onlyDocDirective, outputDir, prettify, printTypeOptions, schemaLocation, skipDocDirective, tmpDir, }: GeneratorOptions) => Promise<void>;
115
104
  //# sourceMappingURL=generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAEV,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,WAAW,EAEX,cAAc,EAEf,MAAM,yBAAyB,CAAC;AA+BjC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAgBX;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,8DAczB,CAAC;AAgBF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,4DAsBrC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,yEAkDrC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,6FAe7B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,wHAgBlC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B,qKA0BxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,qUAwNjC,CAAC"}
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAEV,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,WAAW,EAEX,cAAc,EAEf,MAAM,yBAAyB,CAAC;AA6DjC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,cACb,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,KACrC,OAAO,CAAC,OAAO,CAYjB,CAAC;AAgBF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,aACzB,OAAO,gBACJ,MAAM,KACnB,CAAC,GAAG,SAmBN,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,cACzB,OAAO,SACX,QAAQ,KACd,OAAO,CAAC,SAAS,CAAC,GAAG,SA+CvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,mBACZ,MAAM,eACT,KAAK,CAAC,YAAY,CAAC,KAC/B,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAY9B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,WACzB,aAAa,kBACL,MAAM,cACV,KAAK,CAAC,cAAc,CAAC,UACzB,MAAM,KACb,OAAO,CAAC,OAAO,CAWjB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B,qBACrB,KAAK,CAAC,aAAa,GAAG,aAAa,EAAE,CAAC,oBACtC,KAAK,CAAC,aAAa,GAAG,aAAa,EAAE,CAAC,UAChD,aAAa,KACpB,gBAAgB,EAAE,EAsBpB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,2QAoB/B,gBAAgB,KAAG,OAAO,CAAC,IAAI,CA0MjC,CAAC"}
package/dist/generator.js CHANGED
@@ -33,10 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.generateDocFromSchema = exports.resolveSkipAndOnlyDirectives = exports.checkSchemaDifferences = exports.loadGraphqlSchema = exports.getFormatterFromMDXModule = exports.getMDXModuleProperty = exports.loadMDXModule = exports.FILE_EXTENSION = void 0;
36
+ exports.generateDocFromSchema = exports.resolveSkipAndOnlyDirectives = exports.checkSchemaDifferences = exports.loadGraphqlSchema = exports.getFormatterFromMDXModule = exports.getMDXModuleProperty = exports.loadMDXModule = void 0;
37
37
  const logger_1 = __importStar(require("@graphql-markdown/logger"));
38
38
  const graphql_1 = require("@graphql-markdown/graphql");
39
39
  const utils_1 = require("@graphql-markdown/utils");
40
+ const node_path_1 = require("node:path");
40
41
  const config_1 = require("./config");
41
42
  const diff_1 = require("./diff");
42
43
  const printer_1 = require("./printer");
@@ -51,7 +52,7 @@ const event_handlers_1 = require("./event-handlers");
51
52
  * - MDX: MDX file extension (.mdx) for React component-enabled markdown
52
53
  * - MD: Standard markdown file extension (.md)
53
54
  */
54
- exports.FILE_EXTENSION = {
55
+ const FILE_EXTENSION = {
55
56
  MDX: ".mdx",
56
57
  MD: ".md",
57
58
  };
@@ -273,10 +274,10 @@ exports.resolveSkipAndOnlyDirectives = resolveSkipAndOnlyDirectives;
273
274
  * @param options - Complete configuration for the documentation generation
274
275
  * @returns Promise that resolves when documentation is fully generated
275
276
  */
276
- const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, docOptions, force, groupByDirective, homepageLocation, linkRoot, loaders: loadersList, loggerModule, mdxParser, metatags, onlyDocDirective, outputDir, prettify, printer: printerModule, printTypeOptions, schemaLocation, skipDocDirective, tmpDir, }) => {
277
+ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, docOptions, force, groupByDirective, homepageLocation, linkRoot, loaders: loadersList, loggerModule, formatter, metatags, onlyDocDirective, outputDir, prettify, printTypeOptions, schemaLocation, skipDocDirective, tmpDir, }) => {
277
278
  const start = process.hrtime.bigint();
278
279
  await (0, logger_1.default)(loggerModule);
279
- const mdxModule = await (0, exports.loadMDXModule)(mdxParser);
280
+ const mdxModule = await (0, exports.loadMDXModule)(formatter);
280
281
  // Register MDX lifecycle event handlers if mdxModule loaded successfully
281
282
  // This must be called BEFORE getEvents() because it resets the singleton
282
283
  (0, event_handlers_1.registerMDXEventHandlers)(mdxModule);
@@ -307,12 +308,10 @@ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, doc
307
308
  const customDirectives = (0, graphql_1.getCustomDirectives)(rootTypes, customDirective);
308
309
  const groups = (0, graphql_1.getGroups)(rootTypes, groupByDirective);
309
310
  // Extract formatter from the MDX module (for direct function calls)
310
- const formatter = (0, exports.getFormatterFromMDXModule)(mdxModule, docOptions);
311
+ const mdxFormatter = (0, exports.getFormatterFromMDXModule)(mdxModule, docOptions);
311
312
  // Extract mdxDeclaration from the MDX module (if available)
312
313
  const mdxDeclaration = (0, exports.getMDXModuleProperty)(mdxModule, "mdxDeclaration");
313
314
  const printer = await (0, printer_1.getPrinter)(
314
- // module mandatory
315
- printerModule,
316
315
  // config mandatory
317
316
  {
318
317
  baseURL,
@@ -332,7 +331,7 @@ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, doc
332
331
  printTypeOptions,
333
332
  skipDocDirectives,
334
333
  sectionHeaderId: docOptions?.sectionHeaderId,
335
- }, formatter, mdxDeclaration,
334
+ }, mdxFormatter, mdxDeclaration,
336
335
  // Pass event emitter to enable print events
337
336
  events);
338
337
  // allow mdxModule to specify custom extension
@@ -342,10 +341,10 @@ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, doc
342
341
  mdxExtension = mdxExtensionFromModule;
343
342
  }
344
343
  else if (mdxModule) {
345
- mdxExtension = exports.FILE_EXTENSION.MDX;
344
+ mdxExtension = FILE_EXTENSION.MDX;
346
345
  }
347
346
  else {
348
- mdxExtension = exports.FILE_EXTENSION.MD;
347
+ mdxExtension = FILE_EXTENSION.MD;
349
348
  }
350
349
  const renderer = await (0, renderer_1.getRenderer)(printer, outputDir, baseURL, groups, prettify, {
351
350
  ...docOptions,
@@ -376,6 +375,12 @@ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, doc
376
375
  outputDir,
377
376
  });
378
377
  await events.emitAsync(events_1.RenderHomepageEvents.AFTER_RENDER, afterRenderHomepageEvent);
378
+ await events.emitAsync(events_1.RenderFilesEvents.AFTER_RENDER, new events_1.RenderFilesEvent({
379
+ baseURL,
380
+ outputDir,
381
+ rootDir: (0, node_path_1.dirname)(outputDir),
382
+ pages,
383
+ }));
379
384
  const duration = (Number(process.hrtime.bigint() - start) / NS_PER_SEC).toFixed(SEC_DECIMALS);
380
385
  (0, logger_1.log)(`Documentation successfully generated in "${outputDir}" with base URL "${baseURL}".`, "success");
381
386
  (0, logger_1.log)(`${pages.flat().length} pages generated in ${duration}s from schema "${(0, utils_1.toString)(schemaLocation)}".`);
@@ -7,11 +7,6 @@
7
7
  * @module graphql-config
8
8
  */
9
9
  import type { ExtensionProjectConfig, GraphQLExtensionDeclaration, LoaderOption, Maybe, PackageOptionsConfig } from "@graphql-markdown/types";
10
- /**
11
- * The name of the GraphQL Markdown extension.
12
- * Used to identify the extension in graphql-config.
13
- */
14
- export declare const EXTENSION_NAME: "graphql-markdown";
15
10
  /**
16
11
  * GraphQL extension declaration for graphql-config.
17
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-config.d.ts","sourceRoot":"","sources":["../src/graphql-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAEV,sBAAsB,EACtB,2BAA2B,EAC3B,YAAY,EACZ,KAAK,EAEL,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAUjC;;;GAGG;AACH,eAAO,MAAM,cAAc,oBAA8B,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,EAAE,2BAEpC,CAAC;AAEF;;;;;;GAMG;AACH,UAAU,YAAY;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAWD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gBAAgB,wEAkB5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,iBAAiB,iKAsD7B,CAAC"}
1
+ {"version":3,"file":"graphql-config.d.ts","sourceRoot":"","sources":["../src/graphql-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAEV,sBAAsB,EACtB,2BAA2B,EAC3B,YAAY,EACZ,KAAK,EAEL,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAgBjC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,EAAE,2BAEpC,CAAC;AAEF;;;;;;GAMG;AACH,UAAU,YAAY;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAWD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,eAAO,MAAM,gBAAgB,YAClB,YAAY,WACZ,oBAAoB,KAC5B,YAeF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,iBAAiB,OACxB,KAAK,CAAC,MAAM,CAAC,YACP,KAAK,CAAC,oBAAoB,CAAC,qCACH,YAAY,KAC7C,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAkDjD,CAAC"}
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadConfiguration = exports.setLoaderOptions = exports.graphQLConfigExtension = exports.EXTENSION_NAME = void 0;
3
+ exports.loadConfiguration = exports.setLoaderOptions = exports.graphQLConfigExtension = void 0;
4
4
  const logger_1 = require("@graphql-markdown/logger");
5
5
  const validation_1 = require("./directives/validation");
6
6
  /**
7
7
  * The name of the GraphQL Markdown extension.
8
8
  * Used to identify the extension in graphql-config.
9
9
  */
10
- exports.EXTENSION_NAME = "graphql-markdown";
10
+ const EXTENSION_NAME = "graphql-markdown";
11
11
  /**
12
12
  * GraphQL extension declaration for graphql-config.
13
13
  *
@@ -22,7 +22,7 @@ exports.EXTENSION_NAME = "graphql-markdown";
22
22
  * ```
23
23
  */
24
24
  const graphQLConfigExtension = () => {
25
- return { name: exports.EXTENSION_NAME };
25
+ return { name: EXTENSION_NAME };
26
26
  };
27
27
  exports.graphQLConfigExtension = graphQLConfigExtension;
28
28
  /**
@@ -56,6 +56,9 @@ const DEFAULT_THROW_OPTIONS = {
56
56
  * // Result: loaders with { baseDir: "./src", outputDir: "./docs" }
57
57
  * ```
58
58
  */
59
+ // Exported so tests can jest.spyOn via namespace import; fallow can't trace
60
+ // dynamic spy interception and production: true excludes the test callers.
61
+ // fallow-ignore-next-line unused-export
59
62
  const setLoaderOptions = (loaders, options) => {
60
63
  for (const loader in loaders) {
61
64
  if ((0, validation_1.isLoaderString)(loaders[loader])) {
@@ -126,7 +129,7 @@ const loadConfiguration = async (id, options, { throwOnMissing, throwOnEmpty } =
126
129
  try {
127
130
  const projectConfig = config
128
131
  .getProject(id)
129
- .extension(exports.EXTENSION_NAME);
132
+ .extension(EXTENSION_NAME);
130
133
  if (Array.isArray(projectConfig.schema)) {
131
134
  const schema = projectConfig.schema[0];
132
135
  if ((0, validation_1.isSchemaString)(schema)) {
package/dist/index.d.ts CHANGED
@@ -19,6 +19,6 @@ export type { RenderRootTypesEvent } from "./events/render-root-types";
19
19
  export type { RenderHomepageEvent } from "./events/render-homepage";
20
20
  export type { RenderTypeEntitiesEvent } from "./events/render-type-entities";
21
21
  export type { GenerateIndexMetafileEvent } from "./events/generate-index-metafile";
22
- export type { ComposePageTypeEventData, IPrintCodeEvent, IPrintTypeEvent, PageSection, PageSections, PrintCodeEvent, PrintCodeEventData, PrintTypeEvent, PrintTypeEventData, } from "@graphql-markdown/types";
22
+ export type { ComposePageTypeEventData, IPrintCodeEvent, IPrintTypeEvent, PageSection, PageSections, PrintCodeEventData, PrintTypeEventData, } from "@graphql-markdown/types";
23
23
  export { CancellableEvent } from "@graphql-markdown/utils";
24
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,YAAY,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3E,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,YAAY,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AACnF,YAAY,EACV,wBAAwB,EACxB,eAAe,EACf,eAAe,E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BAAwB,EACxB,eAAe,EACf,eAAe,EACf,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -5,32 +5,32 @@
5
5
  /* istanbul ignore file */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.CancellableEvent = exports.PrintTypeEvents = exports.GenerateIndexMetafileEvents = exports.RenderTypeEntitiesEvents = exports.RenderHomepageEvents = exports.RenderRootTypesEvents = exports.DiffEvents = exports.SchemaEvents = exports.EVENT_CALLBACK_MAP = exports.registerMDXEventHandlers = exports.resetEvents = exports.getEvents = exports.buildConfig = exports.generateDocFromSchema = void 0;
8
- const generator_1 = require("./generator");
8
+ var generator_1 = require("./generator");
9
9
  Object.defineProperty(exports, "generateDocFromSchema", { enumerable: true, get: function () { return generator_1.generateDocFromSchema; } });
10
- const config_1 = require("./config");
10
+ var config_1 = require("./config");
11
11
  Object.defineProperty(exports, "buildConfig", { enumerable: true, get: function () { return config_1.buildConfig; } });
12
12
  // Event system exports
13
- const event_emitter_1 = require("./event-emitter");
13
+ var event_emitter_1 = require("./event-emitter");
14
14
  Object.defineProperty(exports, "getEvents", { enumerable: true, get: function () { return event_emitter_1.getEvents; } });
15
15
  Object.defineProperty(exports, "resetEvents", { enumerable: true, get: function () { return event_emitter_1.resetEvents; } });
16
- const event_handlers_1 = require("./event-handlers");
16
+ var event_handlers_1 = require("./event-handlers");
17
17
  Object.defineProperty(exports, "registerMDXEventHandlers", { enumerable: true, get: function () { return event_handlers_1.registerMDXEventHandlers; } });
18
- const event_map_1 = require("./event-map");
18
+ var event_map_1 = require("./event-map");
19
19
  Object.defineProperty(exports, "EVENT_CALLBACK_MAP", { enumerable: true, get: function () { return event_map_1.EVENT_CALLBACK_MAP; } });
20
20
  // Event constant exports
21
- const schema_events_1 = require("./events/schema-events");
21
+ var schema_events_1 = require("./events/schema-events");
22
22
  Object.defineProperty(exports, "SchemaEvents", { enumerable: true, get: function () { return schema_events_1.SchemaEvents; } });
23
- const diff_events_1 = require("./events/diff-events");
23
+ var diff_events_1 = require("./events/diff-events");
24
24
  Object.defineProperty(exports, "DiffEvents", { enumerable: true, get: function () { return diff_events_1.DiffEvents; } });
25
- const render_root_types_events_1 = require("./events/render-root-types-events");
25
+ var render_root_types_events_1 = require("./events/render-root-types-events");
26
26
  Object.defineProperty(exports, "RenderRootTypesEvents", { enumerable: true, get: function () { return render_root_types_events_1.RenderRootTypesEvents; } });
27
- const render_homepage_events_1 = require("./events/render-homepage-events");
27
+ var render_homepage_events_1 = require("./events/render-homepage-events");
28
28
  Object.defineProperty(exports, "RenderHomepageEvents", { enumerable: true, get: function () { return render_homepage_events_1.RenderHomepageEvents; } });
29
- const render_type_entities_events_1 = require("./events/render-type-entities-events");
29
+ var render_type_entities_events_1 = require("./events/render-type-entities-events");
30
30
  Object.defineProperty(exports, "RenderTypeEntitiesEvents", { enumerable: true, get: function () { return render_type_entities_events_1.RenderTypeEntitiesEvents; } });
31
- const generate_index_metafile_events_1 = require("./events/generate-index-metafile-events");
31
+ var generate_index_metafile_events_1 = require("./events/generate-index-metafile-events");
32
32
  Object.defineProperty(exports, "GenerateIndexMetafileEvents", { enumerable: true, get: function () { return generate_index_metafile_events_1.GenerateIndexMetafileEvents; } });
33
- const print_type_events_1 = require("./events/print-type-events");
33
+ var print_type_events_1 = require("./events/print-type-events");
34
34
  Object.defineProperty(exports, "PrintTypeEvents", { enumerable: true, get: function () { return print_type_events_1.PrintTypeEvents; } });
35
- const utils_1 = require("@graphql-markdown/utils");
35
+ var utils_1 = require("@graphql-markdown/utils");
36
36
  Object.defineProperty(exports, "CancellableEvent", { enumerable: true, get: function () { return utils_1.CancellableEvent; } });
package/dist/printer.d.ts CHANGED
@@ -7,26 +7,23 @@
7
7
  * @module printer
8
8
  *
9
9
  * This module provides the functionality to load and initialize a printer for GraphQL schema documentation.
10
- * It dynamically imports a printer module and configures it with the provided schema and options.
10
+ * It resolves a supported printer module and configures it with the provided schema and options.
11
11
  */
12
- import type { Formatter, IPrinter, Maybe, PackageName, PrinterConfig, PrinterEventEmitter, PrinterOptions } from "@graphql-markdown/types";
12
+ import type { Formatter, IPrinter, Maybe, PrinterConfig, PrinterEventEmitter, PrinterOptions } from "@graphql-markdown/types";
13
13
  /**
14
14
  * Loads and initializes a printer module for GraphQL schema documentation.
15
15
  *
16
- * This function dynamically imports the specified printer module and initializes it
16
+ * This function resolves the specified printer module and initializes it
17
17
  * with the provided configuration and options. The printer is responsible for rendering
18
18
  * GraphQL schema documentation in the desired format.
19
19
  *
20
- * @param printerModule - The name/path of the printer module to load
21
20
  * @param config - Configuration for the printer including schema, baseURL, and linkRoot
22
21
  * @param options - Additional options for customizing the printer's behavior
23
22
  * @param formatter - Optional formatter functions for customizing output format (e.g., MDX)
24
23
  *
25
24
  * @returns A promise that resolves to the initialized Printer instance
26
25
  *
27
- * @throws Will throw an error if printerModule is not a string
28
26
  * @throws Will throw an error if config is not provided
29
- * @throws Will throw an error if the module specified by printerModule cannot be found
30
27
  *
31
28
  * @example
32
29
  * ```typescript
@@ -40,19 +37,21 @@ import type { Formatter, IPrinter, Maybe, PackageName, PrinterConfig, PrinterEve
40
37
  * `);
41
38
  *
42
39
  * const printer = await getPrinter(
43
- * '@graphql-markdown/printer-legacy',
44
40
  * {
45
41
  * schema,
46
42
  * baseURL: '/docs',
47
43
  * linkRoot: 'graphql'
48
44
  * },
49
45
  * {
50
- * printTypeOptions: { includeDeprecationReasons: true }
46
+ * printTypeOptions: { deprecated: 'group' }
51
47
  * }
52
48
  * );
53
49
  *
54
- * const output = printer.printSchema();
50
+ * const queryType = schema.getQueryType();
51
+ * if (queryType) {
52
+ * const output = await printer.printType('Query', queryType);
53
+ * }
55
54
  * ```
56
55
  */
57
- export declare const getPrinter: (printerModule?: Maybe<PackageName>, config?: Maybe<PrinterConfig>, options?: Maybe<PrinterOptions>, formatter?: Partial<Formatter> | undefined, mdxDeclaration?: Maybe<string>, eventEmitter?: Maybe<PrinterEventEmitter>) => Promise<typeof IPrinter>;
56
+ export declare const getPrinter: (config?: Maybe<PrinterConfig>, options?: Maybe<PrinterOptions>, formatter?: Partial<Formatter>, mdxDeclaration?: Maybe<string>, eventEmitter?: Maybe<PrinterEventEmitter>) => Promise<typeof IPrinter>;
58
57
  //# sourceMappingURL=printer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"printer.d.ts","sourceRoot":"","sources":["../src/printer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;GAKG;AACH,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,KAAK,EACL,WAAW,EAEX,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,UAAU,yPAoCtB,CAAC"}
1
+ {"version":3,"file":"printer.d.ts","sourceRoot":"","sources":["../src/printer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;GAKG;AACH,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,KAAK,EACL,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,UAAU,YACZ,KAAK,CAAC,aAAa,CAAC,YACnB,KAAK,CAAC,cAAc,CAAC,cACnB,OAAO,CAAC,SAAS,CAAC,mBACb,KAAK,CAAC,MAAM,CAAC,iBACf,KAAK,CAAC,mBAAmB,CAAC,KACxC,OAAO,CAAC,OAAO,QAAQ,CAiBzB,CAAC"}
package/dist/printer.js CHANGED
@@ -1,23 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPrinter = void 0;
4
+ const printer_legacy_1 = require("@graphql-markdown/printer-legacy");
4
5
  /**
5
6
  * Loads and initializes a printer module for GraphQL schema documentation.
6
7
  *
7
- * This function dynamically imports the specified printer module and initializes it
8
+ * This function resolves the specified printer module and initializes it
8
9
  * with the provided configuration and options. The printer is responsible for rendering
9
10
  * GraphQL schema documentation in the desired format.
10
11
  *
11
- * @param printerModule - The name/path of the printer module to load
12
12
  * @param config - Configuration for the printer including schema, baseURL, and linkRoot
13
13
  * @param options - Additional options for customizing the printer's behavior
14
14
  * @param formatter - Optional formatter functions for customizing output format (e.g., MDX)
15
15
  *
16
16
  * @returns A promise that resolves to the initialized Printer instance
17
17
  *
18
- * @throws Will throw an error if printerModule is not a string
19
18
  * @throws Will throw an error if config is not provided
20
- * @throws Will throw an error if the module specified by printerModule cannot be found
21
19
  *
22
20
  * @example
23
21
  * ```typescript
@@ -31,35 +29,28 @@ exports.getPrinter = void 0;
31
29
  * `);
32
30
  *
33
31
  * const printer = await getPrinter(
34
- * '@graphql-markdown/printer-legacy',
35
32
  * {
36
33
  * schema,
37
34
  * baseURL: '/docs',
38
35
  * linkRoot: 'graphql'
39
36
  * },
40
37
  * {
41
- * printTypeOptions: { includeDeprecationReasons: true }
38
+ * printTypeOptions: { deprecated: 'group' }
42
39
  * }
43
40
  * );
44
41
  *
45
- * const output = printer.printSchema();
42
+ * const queryType = schema.getQueryType();
43
+ * if (queryType) {
44
+ * const output = await printer.printType('Query', queryType);
45
+ * }
46
46
  * ```
47
47
  */
48
- const getPrinter = async (printerModule, config, options, formatter, mdxDeclaration, eventEmitter) => {
49
- if (typeof printerModule !== "string") {
50
- throw new TypeError("Invalid printer module name.");
51
- }
48
+ const getPrinter = async (config, options, formatter, mdxDeclaration, eventEmitter) => {
52
49
  if (!config) {
53
50
  throw new Error("Invalid printer config.");
54
51
  }
55
- try {
56
- const { Printer } = await import(printerModule);
57
- const { schema, baseURL, linkRoot } = config;
58
- await Printer.init(schema, baseURL, linkRoot, { ...options }, formatter, mdxDeclaration, eventEmitter);
59
- return Printer;
60
- }
61
- catch {
62
- throw new Error(`Cannot find module '${printerModule}'.`);
63
- }
52
+ const { schema, baseURL, linkRoot } = config;
53
+ await printer_legacy_1.Printer.init(schema, baseURL, linkRoot, options ?? undefined, formatter, mdxDeclaration, eventEmitter);
54
+ return printer_legacy_1.Printer;
64
55
  };
65
56
  exports.getPrinter = getPrinter;
@@ -1,4 +1,4 @@
1
- import type { ApiGroupOverrideType, Category, Maybe, Printer, RendererDocOptions, SchemaEntitiesGroupMap, SchemaEntity } from "@graphql-markdown/types";
1
+ import type { ApiGroupOverrideType, Category, Maybe, IPrinter, RendererDocOptions, SchemaEntitiesGroupMap, SchemaEntity } from "@graphql-markdown/types";
2
2
  /**
3
3
  * Default group names for API types and non-API types.
4
4
  * This constant provides the base folder structure for organizing GraphQL schema entities.
@@ -36,7 +36,7 @@ export declare const API_GROUPS: Required<ApiGroupOverrideType>;
36
36
  * const folder = getApiGroupFolder(objectType, { operations: "queries" }); // Returns appropriate folder
37
37
  * ```
38
38
  */
39
- export declare const getApiGroupFolder: (type: unknown, groups?: Maybe<boolean | ApiGroupOverrideType>) => string;
39
+ export declare const getApiGroupFolder: (type: unknown, groups?: Maybe<ApiGroupOverrideType | boolean>) => string;
40
40
  /**
41
41
  * Configuration options for category metafiles in the documentation.
42
42
  * These options control the appearance and behavior of category sections in the sidebar.
@@ -96,7 +96,7 @@ export declare class Renderer {
96
96
  * @param mdxExtension - Optional MDX file extension to use
97
97
  * @example
98
98
  */
99
- constructor(printer: Printer, outputDir: string, baseURL: string, group: Maybe<SchemaEntitiesGroupMap>, prettify: boolean, docOptions: Maybe<RendererDocOptions>, mdxExtension: string);
99
+ constructor(printer: typeof IPrinter, outputDir: string, baseURL: string, group: Maybe<SchemaEntitiesGroupMap>, prettify: boolean, docOptions: Maybe<RendererDocOptions>, mdxExtension: string);
100
100
  /**
101
101
  * Generates an index metafile for a category directory if MDX support is available.
102
102
  *
@@ -243,5 +243,5 @@ export declare class Renderer {
243
243
  * );
244
244
  * ```
245
245
  */
246
- export declare const getRenderer: (printer: typeof import("@graphql-markdown/types").IPrinter, outputDir: string, baseURL: string, group: Maybe<Partial<Record<SchemaEntity, Record<string, Maybe<string>>>>>, prettify: boolean, docOptions: Maybe<RendererDocOptions>, mdxExtension: string) => Promise<Renderer>;
246
+ export declare const getRenderer: (printer: typeof IPrinter, outputDir: string, baseURL: string, group: Maybe<SchemaEntitiesGroupMap>, prettify: boolean, docOptions: Maybe<RendererDocOptions>, mdxExtension: string) => Promise<InstanceType<typeof Renderer>>;
247
247
  //# sourceMappingURL=renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,QAAQ,EAER,KAAK,EAEL,OAAO,EACP,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EAGb,MAAM,yBAAyB,CAAC;AA2FjC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAG5C,CAAC;AAEX;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,2EAS7B,CAAC;AA6CF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAoGD;;;;;;;;;;GAUG;AACH,qBAAa,QAAQ;IACnB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,C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CAAC,CAkH1B;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,IAAI,CAwClD;IAED;;;;;;;OAOG;IACG,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCnE;IAED;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAe5B;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B;IAiClC;;;;;;;OAOG;IACH,OAAO,CAAC,wBAAwB;IAiBhC;;;;;;OAMG;IACH,OAAO,CAAC,8BAA8B;IAiCtC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,wBAAwB;CA+BjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,WAAW,YACb,OAAO,QAAQ,aACb,MAAM,WACR,MAAM,SACR,KAAK,CAAC,sBAAsB,CAAC,YAC1B,OAAO,cACL,KAAK,CAAC,kBAAkB,CAAC,gBACvB,MAAM,KACnB,OAAO,CAAC,YAAY,CAAC,OAAO,QAAQ,CAAC,CAWvC,CAAC"}
package/dist/renderer.js CHANGED
@@ -512,19 +512,19 @@ class Renderer {
512
512
  const extractedCategory = isFlat
513
513
  ? page.groups.pageId
514
514
  : stripNumericPrefix(page.groups.category);
515
- const slug = isFlat
516
- ? page.groups.pageId
517
- : utils_1.pathUrl.join(extractedCategory, page.groups.pageId);
518
515
  const category = isFlat ? "schema" : (0, utils_1.startCase)(extractedCategory);
519
516
  const events = (0, event_emitter_1.getEvents)();
520
517
  const event = new events_1.RenderTypeEntitiesEvent({
518
+ baseURL: this.baseURL,
521
519
  name,
522
520
  filePath,
521
+ outputDir: this.outputDir,
523
522
  });
524
523
  await events.emitAsync(events_1.RenderTypeEntitiesEvents.AFTER_RENDER, event);
525
524
  return {
526
525
  category,
527
- slug,
526
+ filePath,
527
+ name,
528
528
  };
529
529
  }
530
530
  /**
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.20.0",
8
+ "version": "1.21.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -73,24 +73,21 @@
73
73
  },
74
74
  "dependencies": {
75
75
  "@fastify/deepmerge": "^3.2.1",
76
- "@graphql-markdown/graphql": "^1.2.1",
77
- "@graphql-markdown/logger": "^1.0.6",
78
- "@graphql-markdown/types": "^1.12.0",
79
- "@graphql-markdown/utils": "^1.11.0"
76
+ "@graphql-markdown/graphql": "^1.2.2",
77
+ "@graphql-markdown/logger": "^1.0.7",
78
+ "@graphql-markdown/printer-legacy": "^1.16.0",
79
+ "@graphql-markdown/types": "^1.13.0",
80
+ "@graphql-markdown/utils": "^1.12.0"
80
81
  },
81
82
  "devDependencies": {
82
83
  "@graphql-markdown/tooling-config": "^1.0.0"
83
84
  },
84
85
  "peerDependencies": {
85
- "@graphql-markdown/diff": "^1.1.14",
86
- "@graphql-markdown/helpers": "^1.0.13",
87
- "@graphql-markdown/printer-legacy": "^1.15.0",
86
+ "@graphql-markdown/diff": "^1.1.15",
87
+ "@graphql-markdown/helpers": "^1.1.0",
88
88
  "graphql-config": "5.1.6"
89
89
  },
90
90
  "peerDependenciesMeta": {
91
- "@graphql-markdown/printer-legacy": {
92
- "optional": true
93
- },
94
91
  "@graphql-markdown/diff": {
95
92
  "optional": true
96
93
  },