@graphql-markdown/core 1.19.0 → 1.20.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.
- package/assets/generated.md +1 -8
- package/dist/config.d.ts +8 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +33 -8
- package/dist/const/patterns.d.ts +9 -9
- package/dist/const/patterns.js +9 -9
- package/dist/diff.js +1 -34
- package/dist/directives/normalize.d.ts.map +1 -1
- package/dist/directives/normalize.js +3 -1
- package/dist/event-emitter.d.ts +7 -2
- package/dist/event-emitter.d.ts.map +1 -1
- package/dist/event-emitter.js +32 -23
- package/dist/event-map.d.ts +1 -0
- package/dist/event-map.d.ts.map +1 -1
- package/dist/event-map.js +1 -0
- package/dist/events/diff-check.d.ts +7 -8
- package/dist/events/diff-check.d.ts.map +1 -1
- package/dist/events/diff-check.js +3 -6
- package/dist/events/generate-index-metafile.d.ts +7 -8
- package/dist/events/generate-index-metafile.d.ts.map +1 -1
- package/dist/events/generate-index-metafile.js +3 -6
- package/dist/events/index.d.ts +1 -3
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +1 -8
- package/dist/events/print-type-events.d.ts +5 -2
- package/dist/events/print-type-events.d.ts.map +1 -1
- package/dist/events/print-type-events.js +5 -2
- package/dist/events/print-type.d.ts +4 -78
- package/dist/events/print-type.d.ts.map +1 -1
- package/dist/events/print-type.js +3 -66
- package/dist/events/render-homepage.d.ts +5 -6
- package/dist/events/render-homepage.d.ts.map +1 -1
- package/dist/events/render-homepage.js +3 -6
- package/dist/events/render-root-types.d.ts +5 -6
- package/dist/events/render-root-types.d.ts.map +1 -1
- package/dist/events/render-root-types.js +3 -6
- package/dist/events/render-type-entities.d.ts +6 -7
- package/dist/events/render-type-entities.d.ts.map +1 -1
- package/dist/events/render-type-entities.js +3 -6
- package/dist/events/schema-load.d.ts +7 -8
- package/dist/events/schema-load.d.ts.map +1 -1
- package/dist/events/schema-load.js +3 -6
- package/dist/generator.js +1 -1
- package/dist/graphql-config.js +1 -34
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/options/builder.d.ts +13 -13
- package/dist/options/builder.d.ts.map +1 -1
- package/dist/options/builder.js +25 -25
- package/dist/printer.js +1 -34
- package/dist/renderer.d.ts +1 -1
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.js +20 -11
- package/package.json +24 -13
- package/dist/events/base.d.ts +0 -119
- package/dist/events/base.d.ts.map +0 -1
- package/dist/events/base.js +0 -149
package/assets/generated.md
CHANGED
|
@@ -9,11 +9,4 @@ pagination_prev: null
|
|
|
9
9
|
sidebar_class_name: navbar__toggle
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
This documentation has been automatically generated from the GraphQL schema.
|
|
13
|
-
|
|
14
|
-
Use the docs in the sidebar to find out how to use the schema:
|
|
15
|
-
|
|
16
|
-
- **Allowed operations**: queries and mutations.
|
|
17
|
-
- **Schema-defined types**: scalars, objects, enums, interfaces, unions, and input objects.
|
|
18
|
-
|
|
19
|
-
<small><i>Generated on ##generated-date-time##.</i></small>
|
|
12
|
+
This documentation has been automatically generated from the GraphQL schema with [GraphQL-Markdown](https://graphql-markdown.dev/).
|
package/dist/config.d.ts
CHANGED
|
@@ -291,14 +291,16 @@ export declare const getDocOptions: (cliOpts?: Maybe<CliOptions & Omit<Deprecate
|
|
|
291
291
|
*/
|
|
292
292
|
export declare const getTypeHierarchyOption: (cliOption?: Maybe<TypeHierarchyValueType>, configOption?: Maybe<TypeHierarchyType>) => Maybe<Partial<Record<TypeHierarchyValueType, import("@graphql-markdown/types").TypeHierarchyTypeOptions>>>;
|
|
293
293
|
/**
|
|
294
|
-
*
|
|
295
|
-
* Currently returns an empty object as these options are deprecated.
|
|
294
|
+
* Handles deprecated print type options.
|
|
296
295
|
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
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
|
|
300
302
|
*/
|
|
301
|
-
export declare const parseDeprecatedPrintTypeOptions: (
|
|
303
|
+
export declare const parseDeprecatedPrintTypeOptions: (cliOpts: Maybe<Pick<CliOptions, "noCode" | "noExample" | "noRelatedType">>, configOptions: Maybe<Pick<ConfigPrintTypeOptions, "codeSection" | "exampleSection" | "relatedTypeSection">>) => Record<string, never>;
|
|
302
304
|
/**
|
|
303
305
|
* Builds the print type options by merging CLI options, config file options, and defaults.
|
|
304
306
|
* Handles various formatting options for type documentation.
|
package/dist/config.d.ts.map
CHANGED
|
@@ -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;
|
|
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,CAAC;AACpE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAKnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;CAA8B,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CACpC,IAAI,CAAC,aAAa,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,SAAS,CAAC,GACrE,QAAQ,CACN,IAAI,CACF,aAAa,EACX,iBAAiB,GACjB,kBAAkB,GAClB,SAAS,GACT,WAAW,GACX,kBAAkB,CACrB,CACF,CACJ,GAAG;IACF,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC,GAAG;QACtE,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;KACvE,CAAC;CAyCM,CAAC;AAEX;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,+CAY3B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB,iHAchC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,sIAwBhC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,uBAAuB;;;CAuBnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,mBAAmB,uHA+B/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,sBAE/B,CAAC;AAEF,eAAO,MAAM,uBAAuB,0CAInC,CAAC;AAEF,eAAO,MAAM,aAAa,0CAEzB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,mJAKrC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,wLA2BzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,sBAAsB,oMA0ClC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B,oNA8C3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,mBAAmB,wMAgC/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,kBAAkB,2DAkB9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,8FAiB/B,CAAC;AAmDF,eAAO,MAAM,WAAW,6GAyFvB,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -25,6 +25,7 @@ const graphql_config_1 = require("./graphql-config");
|
|
|
25
25
|
const patterns_1 = require("./const/patterns");
|
|
26
26
|
const validation_1 = require("./directives/validation");
|
|
27
27
|
const builder_1 = require("./options/builder");
|
|
28
|
+
const logger_1 = require("@graphql-markdown/logger");
|
|
28
29
|
/**
|
|
29
30
|
* Type hierarchy options for organizing schema documentation.
|
|
30
31
|
*
|
|
@@ -443,14 +444,34 @@ const getTypeHierarchyOption = (cliOption, configOption) => {
|
|
|
443
444
|
};
|
|
444
445
|
exports.getTypeHierarchyOption = getTypeHierarchyOption;
|
|
445
446
|
/**
|
|
446
|
-
*
|
|
447
|
-
* Currently returns an empty object as these options are deprecated.
|
|
447
|
+
* Handles deprecated print type options.
|
|
448
448
|
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
*
|
|
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
|
|
452
455
|
*/
|
|
453
|
-
const parseDeprecatedPrintTypeOptions = (
|
|
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);
|
|
474
|
+
}
|
|
454
475
|
return {};
|
|
455
476
|
};
|
|
456
477
|
exports.parseDeprecatedPrintTypeOptions = parseDeprecatedPrintTypeOptions;
|
|
@@ -485,9 +506,7 @@ exports.parseDeprecatedPrintTypeOptions = parseDeprecatedPrintTypeOptions;
|
|
|
485
506
|
* @see {@link getTypeHierarchyOption} for hierarchy resolution
|
|
486
507
|
*/
|
|
487
508
|
const getPrintTypeOptions = (cliOpts, configOptions) => {
|
|
488
|
-
const deprecated = (0, exports.parseDeprecatedPrintTypeOptions)(cliOpts, configOptions);
|
|
489
509
|
return {
|
|
490
|
-
...deprecated,
|
|
491
510
|
codeSection: (!cliOpts?.noCode && configOptions?.codeSection) ??
|
|
492
511
|
exports.DEFAULT_OPTIONS.printTypeOptions.codeSection,
|
|
493
512
|
deprecated: (cliOpts?.deprecated ??
|
|
@@ -563,6 +582,12 @@ exports.parseHomepageOption = parseHomepageOption;
|
|
|
563
582
|
const buildConfig = async (configFileOpts, cliOpts, id = "default") => {
|
|
564
583
|
cliOpts ??= {};
|
|
565
584
|
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
|
+
(0, exports.parseDeprecatedPrintTypeOptions)(cliOpts, {
|
|
588
|
+
...graphqlConfig?.printTypeOptions,
|
|
589
|
+
...configFileOpts?.printTypeOptions,
|
|
590
|
+
});
|
|
566
591
|
const config = (0, deepmerge_1.deepmerge)()({ ...exports.DEFAULT_OPTIONS, ...graphqlConfig }, configFileOpts ?? {});
|
|
567
592
|
const { onlyDocDirective, skipDocDirective } = (0, exports.getVisibilityDirectives)(cliOpts, config);
|
|
568
593
|
// Build options using consistent precedence: CLI > Config > Default
|
package/dist/const/patterns.d.ts
CHANGED
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
export declare const PATTERNS: {
|
|
20
20
|
/**
|
|
21
21
|
* Matches directive names with named capture groups.
|
|
22
|
-
* Captures the directive name after the
|
|
22
|
+
* Captures the directive name after the \@ symbol.
|
|
23
23
|
*
|
|
24
|
-
* @pattern
|
|
24
|
+
* @pattern `^\@(?<directive>\w+)$`
|
|
25
25
|
* @example
|
|
26
|
-
* - "
|
|
27
|
-
* - "
|
|
28
|
-
* - "
|
|
26
|
+
* - "\@tag" matches → directive: "tag"
|
|
27
|
+
* - "\@myDirective" matches → directive: "myDirective"
|
|
28
|
+
* - "\@" does not match
|
|
29
29
|
* - "tag" does not match
|
|
30
30
|
*/
|
|
31
31
|
readonly DIRECTIVE_NAME: RegExp;
|
|
@@ -33,11 +33,11 @@ export declare const PATTERNS: {
|
|
|
33
33
|
* Matches group-by directive format with directive name, field, and optional fallback.
|
|
34
34
|
* Groups: (1) directive name, (2) field name, (3) optional fallback
|
|
35
35
|
*
|
|
36
|
-
* @pattern
|
|
36
|
+
* @pattern `^\@(\w+)\((\w+)(?:\|=(\w+))?\)$`
|
|
37
37
|
* @example
|
|
38
|
-
* - "
|
|
39
|
-
* - "
|
|
40
|
-
* - "
|
|
38
|
+
* - "\@tag(name)" matches → ["\@tag(name)", "tag", "name", undefined]
|
|
39
|
+
* - "\@category(type|=Other)" matches → ["\@category(type|=Other)", "category", "type", "Other"]
|
|
40
|
+
* - "\@tag()" does not match
|
|
41
41
|
* - "tag(name)" does not match
|
|
42
42
|
*/
|
|
43
43
|
readonly GROUP_BY_DIRECTIVE: RegExp;
|
package/dist/const/patterns.js
CHANGED
|
@@ -22,13 +22,13 @@ exports.CONFIG_CONSTANTS = exports.PATTERNS = void 0;
|
|
|
22
22
|
exports.PATTERNS = {
|
|
23
23
|
/**
|
|
24
24
|
* Matches directive names with named capture groups.
|
|
25
|
-
* Captures the directive name after the
|
|
25
|
+
* Captures the directive name after the \@ symbol.
|
|
26
26
|
*
|
|
27
|
-
* @pattern
|
|
27
|
+
* @pattern `^\@(?<directive>\w+)$`
|
|
28
28
|
* @example
|
|
29
|
-
* - "
|
|
30
|
-
* - "
|
|
31
|
-
* - "
|
|
29
|
+
* - "\@tag" matches → directive: "tag"
|
|
30
|
+
* - "\@myDirective" matches → directive: "myDirective"
|
|
31
|
+
* - "\@" does not match
|
|
32
32
|
* - "tag" does not match
|
|
33
33
|
*/
|
|
34
34
|
DIRECTIVE_NAME: /^@(?<directive>\w+)$/, // NOSONAR: S5843
|
|
@@ -36,11 +36,11 @@ exports.PATTERNS = {
|
|
|
36
36
|
* Matches group-by directive format with directive name, field, and optional fallback.
|
|
37
37
|
* Groups: (1) directive name, (2) field name, (3) optional fallback
|
|
38
38
|
*
|
|
39
|
-
* @pattern
|
|
39
|
+
* @pattern `^\@(\w+)\((\w+)(?:\|=(\w+))?\)$`
|
|
40
40
|
* @example
|
|
41
|
-
* - "
|
|
42
|
-
* - "
|
|
43
|
-
* - "
|
|
41
|
+
* - "\@tag(name)" matches → ["\@tag(name)", "tag", "name", undefined]
|
|
42
|
+
* - "\@category(type|=Other)" matches → ["\@category(type|=Other)", "category", "type", "Other"]
|
|
43
|
+
* - "\@tag()" does not match
|
|
44
44
|
* - "tag(name)" does not match
|
|
45
45
|
*/
|
|
46
46
|
GROUP_BY_DIRECTIVE: /^@(\w+)\((\w+)(?:\|=(\w+))?\)$/, // NOSONAR: S5843
|
package/dist/diff.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.hasChanges = void 0;
|
|
37
4
|
const logger_1 = require("@graphql-markdown/logger");
|
|
@@ -91,7 +58,7 @@ const hasChanges = async (schema, tmpDir, diffMethod, diffModule = "@graphql-mar
|
|
|
91
58
|
return true;
|
|
92
59
|
}
|
|
93
60
|
try {
|
|
94
|
-
const { checkSchemaChanges, } = await
|
|
61
|
+
const { checkSchemaChanges, } = await import(diffModule);
|
|
95
62
|
return await checkSchemaChanges(schema, tmpDir, diffMethod);
|
|
96
63
|
}
|
|
97
64
|
catch {
|
|
@@ -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,
|
|
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"}
|
|
@@ -41,7 +41,9 @@ exports.combineDirectiveNames = exports.uniqueDirectiveNames = exports.normalize
|
|
|
41
41
|
*/
|
|
42
42
|
const normalizeDirectiveNames = (...sources) => {
|
|
43
43
|
return sources
|
|
44
|
-
.filter((s) =>
|
|
44
|
+
.filter((s) => {
|
|
45
|
+
return Array.isArray(s) && s.length > 0;
|
|
46
|
+
})
|
|
45
47
|
.flat();
|
|
46
48
|
};
|
|
47
49
|
exports.normalizeDirectiveNames = normalizeDirectiveNames;
|
package/dist/event-emitter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
|
-
import type { ICancellableEvent
|
|
2
|
+
import type { ICancellableEvent } from "@graphql-markdown/types";
|
|
3
3
|
/**
|
|
4
4
|
* Result object returned when emitting a cancellable event.
|
|
5
5
|
*
|
|
@@ -29,6 +29,8 @@ export interface EmitResult {
|
|
|
29
29
|
* @category Events
|
|
30
30
|
*/
|
|
31
31
|
declare class CancellableEventEmitter extends EventEmitter {
|
|
32
|
+
private static toError;
|
|
33
|
+
private static isDefaultPrevented;
|
|
32
34
|
/**
|
|
33
35
|
* Emit an event asynchronously with cancellable event support.
|
|
34
36
|
*
|
|
@@ -61,7 +63,10 @@ declare class CancellableEventEmitter extends EventEmitter {
|
|
|
61
63
|
* }
|
|
62
64
|
* ```
|
|
63
65
|
*/
|
|
64
|
-
emitAsync(eventName: string, event: ICancellableEvent
|
|
66
|
+
emitAsync(eventName: string, event: ICancellableEvent): Promise<EmitResult>;
|
|
67
|
+
private invokeListener;
|
|
68
|
+
private emitToListeners;
|
|
69
|
+
private runDefaultAction;
|
|
65
70
|
}
|
|
66
71
|
/**
|
|
67
72
|
* Get the singleton event emitter instance.
|
|
@@ -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,
|
|
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"}
|
package/dist/event-emitter.js
CHANGED
|
@@ -14,6 +14,14 @@ const node_events_1 = require("node:events");
|
|
|
14
14
|
* @category Events
|
|
15
15
|
*/
|
|
16
16
|
class CancellableEventEmitter extends node_events_1.EventEmitter {
|
|
17
|
+
static toError(error) {
|
|
18
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
19
|
+
}
|
|
20
|
+
static isDefaultPrevented(event) {
|
|
21
|
+
return "defaultPrevented" in event
|
|
22
|
+
? !!event.defaultPrevented
|
|
23
|
+
: false;
|
|
24
|
+
}
|
|
17
25
|
/**
|
|
18
26
|
* Emit an event asynchronously with cancellable event support.
|
|
19
27
|
*
|
|
@@ -52,39 +60,40 @@ class CancellableEventEmitter extends node_events_1.EventEmitter {
|
|
|
52
60
|
const listeners = this.listeners(eventName);
|
|
53
61
|
// Check if event is a full cancellable event (has propagationStopped property)
|
|
54
62
|
const isCancellable = "propagationStopped" in event;
|
|
55
|
-
|
|
63
|
+
await this.emitToListeners(listeners, event, errors, isCancellable);
|
|
64
|
+
await this.runDefaultAction(event, errors);
|
|
65
|
+
return {
|
|
66
|
+
errors,
|
|
67
|
+
defaultPrevented: CancellableEventEmitter.isDefaultPrevented(event),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
async invokeListener(listener, event) {
|
|
71
|
+
await Promise.resolve(listener(event));
|
|
72
|
+
}
|
|
73
|
+
async emitToListeners(listeners, event, errors, isCancellable) {
|
|
56
74
|
for (const listener of listeners) {
|
|
57
75
|
try {
|
|
58
|
-
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
|
|
60
|
-
await listener(event);
|
|
61
|
-
// Check if handler stopped propagation to remaining handlers
|
|
76
|
+
await this.invokeListener(listener, event);
|
|
62
77
|
if (isCancellable &&
|
|
63
78
|
event.propagationStopped) {
|
|
64
|
-
break;
|
|
79
|
+
break;
|
|
65
80
|
}
|
|
66
81
|
}
|
|
67
82
|
catch (error) {
|
|
68
|
-
|
|
69
|
-
errors.push(error instanceof Error ? error : new Error(String(error)));
|
|
83
|
+
errors.push(CancellableEventEmitter.toError(error));
|
|
70
84
|
}
|
|
71
85
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
}
|
|
87
|
+
async runDefaultAction(event, errors) {
|
|
88
|
+
if (!("runDefaultAction" in event)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
await event.runDefaultAction();
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
errors.push(CancellableEventEmitter.toError(error));
|
|
82
96
|
}
|
|
83
|
-
// Check defaultPrevented - simple events may have this property
|
|
84
|
-
const defaultPrevented = "defaultPrevented" in event
|
|
85
|
-
? !!event.defaultPrevented
|
|
86
|
-
: false;
|
|
87
|
-
return { errors, defaultPrevented };
|
|
88
97
|
}
|
|
89
98
|
}
|
|
90
99
|
/**
|
package/dist/event-map.d.ts
CHANGED
|
@@ -22,5 +22,6 @@ export declare const EVENT_CALLBACK_MAP: {
|
|
|
22
22
|
readonly "print:afterPrintCode": "afterPrintCodeHook";
|
|
23
23
|
readonly "print:beforePrintType": "beforePrintTypeHook";
|
|
24
24
|
readonly "print:afterPrintType": "afterPrintTypeHook";
|
|
25
|
+
readonly "print:beforeComposePageType": "beforeComposePageTypeHook";
|
|
25
26
|
};
|
|
26
27
|
//# sourceMappingURL=event-map.d.ts.map
|
package/dist/event-map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-map.d.ts","sourceRoot":"","sources":["../src/event-map.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"event-map.d.ts","sourceRoot":"","sources":["../src/event-map.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;CAoBrB,CAAC"}
|
package/dist/event-map.js
CHANGED
|
@@ -40,4 +40,5 @@ exports.EVENT_CALLBACK_MAP = {
|
|
|
40
40
|
[print_type_events_1.PrintTypeEvents.AFTER_PRINT_CODE]: "afterPrintCodeHook",
|
|
41
41
|
[print_type_events_1.PrintTypeEvents.BEFORE_PRINT_TYPE]: "beforePrintTypeHook",
|
|
42
42
|
[print_type_events_1.PrintTypeEvents.AFTER_PRINT_TYPE]: "afterPrintTypeHook",
|
|
43
|
+
[print_type_events_1.PrintTypeEvents.BEFORE_COMPOSE_PAGE_TYPE]: "beforeComposePageTypeHook",
|
|
43
44
|
};
|
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import type { CancellableEventOptions } from "@graphql-markdown/utils";
|
|
7
|
+
import { DataEvent } from "@graphql-markdown/utils";
|
|
7
8
|
/**
|
|
8
9
|
* Event emitted before/after checking schema differences.
|
|
9
10
|
*
|
|
10
11
|
* @category Events
|
|
11
12
|
*/
|
|
12
|
-
export declare class DiffCheckEvent extends
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
schemaHasChanges?: boolean;
|
|
18
|
-
};
|
|
13
|
+
export declare class DiffCheckEvent extends DataEvent<{
|
|
14
|
+
schema?: unknown;
|
|
15
|
+
outputDir?: string;
|
|
16
|
+
schemaHasChanges?: boolean;
|
|
17
|
+
}> {
|
|
19
18
|
constructor(data: {
|
|
20
19
|
schema?: unknown;
|
|
21
20
|
outputDir?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-check.d.ts","sourceRoot":"","sources":["../../src/events/diff-check.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"diff-check.d.ts","sourceRoot":"","sources":["../../src/events/diff-check.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,cAAe,SAAQ,SAAS,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;IACA,YACE,IAAI,EAAE;QACJ,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,EACD,OAAO,CAAC,EAAE,uBAAuB,EAGlC;CACF"}
|
|
@@ -6,18 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.DiffCheckEvent = void 0;
|
|
9
|
-
const
|
|
9
|
+
const utils_1 = require("@graphql-markdown/utils");
|
|
10
10
|
/**
|
|
11
11
|
* Event emitted before/after checking schema differences.
|
|
12
12
|
*
|
|
13
13
|
* @category Events
|
|
14
14
|
*/
|
|
15
|
-
class DiffCheckEvent extends
|
|
16
|
-
/** Event data containing schema, output directory, and change status */
|
|
17
|
-
data;
|
|
15
|
+
class DiffCheckEvent extends utils_1.DataEvent {
|
|
18
16
|
constructor(data, options) {
|
|
19
|
-
super(options);
|
|
20
|
-
this.data = data;
|
|
17
|
+
super(data, options);
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
exports.DiffCheckEvent = DiffCheckEvent;
|
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import type { CancellableEventOptions } from "@graphql-markdown/utils";
|
|
7
|
+
import { DataEvent } from "@graphql-markdown/utils";
|
|
7
8
|
/**
|
|
8
9
|
* Event emitted before/after generating index metafile.
|
|
9
10
|
*
|
|
10
11
|
* @category Events
|
|
11
12
|
*/
|
|
12
|
-
export declare class GenerateIndexMetafileEvent extends
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
options?: Record<string, unknown>;
|
|
18
|
-
};
|
|
13
|
+
export declare class GenerateIndexMetafileEvent extends DataEvent<{
|
|
14
|
+
dirPath: string;
|
|
15
|
+
category: string;
|
|
16
|
+
options?: Record<string, unknown>;
|
|
17
|
+
}> {
|
|
19
18
|
constructor(data: {
|
|
20
19
|
dirPath: string;
|
|
21
20
|
category: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-index-metafile.d.ts","sourceRoot":"","sources":["../../src/events/generate-index-metafile.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generate-index-metafile.d.ts","sourceRoot":"","sources":["../../src/events/generate-index-metafile.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,0BAA2B,SAAQ,SAAS,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;IACA,YACE,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,EACD,OAAO,CAAC,EAAE,uBAAuB,EAGlC;CACF"}
|
|
@@ -6,18 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.GenerateIndexMetafileEvent = void 0;
|
|
9
|
-
const
|
|
9
|
+
const utils_1 = require("@graphql-markdown/utils");
|
|
10
10
|
/**
|
|
11
11
|
* Event emitted before/after generating index metafile.
|
|
12
12
|
*
|
|
13
13
|
* @category Events
|
|
14
14
|
*/
|
|
15
|
-
class GenerateIndexMetafileEvent extends
|
|
16
|
-
/** Event data containing directory path, category, and options */
|
|
17
|
-
data;
|
|
15
|
+
class GenerateIndexMetafileEvent extends utils_1.DataEvent {
|
|
18
16
|
constructor(data, options) {
|
|
19
|
-
super(options);
|
|
20
|
-
this.data = data;
|
|
17
|
+
super(data, options);
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
exports.GenerateIndexMetafileEvent = GenerateIndexMetafileEvent;
|
package/dist/events/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
export { CancellableEvent, deepFreeze } from "./base";
|
|
7
6
|
export { SchemaEvents } from "./schema-events";
|
|
8
7
|
export { DiffEvents } from "./diff-events";
|
|
9
8
|
export { RenderRootTypesEvents } from "./render-root-types-events";
|
|
@@ -17,6 +16,5 @@ export { RenderRootTypesEvent } from "./render-root-types";
|
|
|
17
16
|
export { RenderHomepageEvent } from "./render-homepage";
|
|
18
17
|
export { RenderTypeEntitiesEvent } from "./render-type-entities";
|
|
19
18
|
export { GenerateIndexMetafileEvent } from "./generate-index-metafile";
|
|
20
|
-
export {
|
|
21
|
-
export type { PrintCodeEventData, PrintTypeEventData } from "./print-type";
|
|
19
|
+
export type { PrintCodeEventData, PrintTypeEventData, ComposePageTypeEventData, PageSection, PageSections, } from "@graphql-markdown/types";
|
|
22
20
|
//# 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,
|
|
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"}
|
package/dist/events/index.js
CHANGED
|
@@ -5,11 +5,7 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
9
|
-
// Base
|
|
10
|
-
const base_1 = require("./base");
|
|
11
|
-
Object.defineProperty(exports, "CancellableEvent", { enumerable: true, get: function () { return base_1.CancellableEvent; } });
|
|
12
|
-
Object.defineProperty(exports, "deepFreeze", { enumerable: true, get: function () { return base_1.deepFreeze; } });
|
|
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;
|
|
13
9
|
// Event constants
|
|
14
10
|
const schema_events_1 = require("./schema-events");
|
|
15
11
|
Object.defineProperty(exports, "SchemaEvents", { enumerable: true, get: function () { return schema_events_1.SchemaEvents; } });
|
|
@@ -38,6 +34,3 @@ const render_type_entities_1 = require("./render-type-entities");
|
|
|
38
34
|
Object.defineProperty(exports, "RenderTypeEntitiesEvent", { enumerable: true, get: function () { return render_type_entities_1.RenderTypeEntitiesEvent; } });
|
|
39
35
|
const generate_index_metafile_1 = require("./generate-index-metafile");
|
|
40
36
|
Object.defineProperty(exports, "GenerateIndexMetafileEvent", { enumerable: true, get: function () { return generate_index_metafile_1.GenerateIndexMetafileEvent; } });
|
|
41
|
-
const print_type_1 = require("./print-type");
|
|
42
|
-
Object.defineProperty(exports, "PrintCodeEvent", { enumerable: true, get: function () { return print_type_1.PrintCodeEvent; } });
|
|
43
|
-
Object.defineProperty(exports, "PrintTypeEvent", { enumerable: true, get: function () { return print_type_1.PrintTypeEvent; } });
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```typescript
|
|
14
|
-
* import { getEvents, PrintTypeEvents
|
|
14
|
+
* import { getEvents, PrintTypeEvents } from "@graphql-markdown/core";
|
|
15
|
+
* import { PrintCodeEvent } from "@graphql-markdown/printer-legacy";
|
|
15
16
|
*
|
|
16
17
|
* const events = getEvents();
|
|
17
|
-
* events.on(PrintTypeEvents.AFTER_PRINT_CODE, (event:
|
|
18
|
+
* events.on(PrintTypeEvents.AFTER_PRINT_CODE, (event: PrintCodeEvent) => {
|
|
18
19
|
* // Modify the generated code
|
|
19
20
|
* event.output = event.output.toUpperCase();
|
|
20
21
|
* });
|
|
@@ -29,5 +30,7 @@ export declare const PrintTypeEvents: {
|
|
|
29
30
|
readonly BEFORE_PRINT_TYPE: "print:beforePrintType";
|
|
30
31
|
/** Emitted after generating the full type documentation (output can be modified) */
|
|
31
32
|
readonly AFTER_PRINT_TYPE: "print:afterPrintType";
|
|
33
|
+
/** Emitted before composing page sections (can modify section content) */
|
|
34
|
+
readonly BEFORE_COMPOSE_PAGE_TYPE: "print:beforeComposePageType";
|
|
32
35
|
};
|
|
33
36
|
//# sourceMappingURL=print-type-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-type-events.d.ts","sourceRoot":"","sources":["../../src/events/print-type-events.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH
|
|
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"}
|
|
@@ -14,10 +14,11 @@ exports.PrintTypeEvents = void 0;
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import { getEvents, PrintTypeEvents
|
|
17
|
+
* import { getEvents, PrintTypeEvents } from "@graphql-markdown/core";
|
|
18
|
+
* import { PrintCodeEvent } from "@graphql-markdown/printer-legacy";
|
|
18
19
|
*
|
|
19
20
|
* const events = getEvents();
|
|
20
|
-
* events.on(PrintTypeEvents.AFTER_PRINT_CODE, (event:
|
|
21
|
+
* events.on(PrintTypeEvents.AFTER_PRINT_CODE, (event: PrintCodeEvent) => {
|
|
21
22
|
* // Modify the generated code
|
|
22
23
|
* event.output = event.output.toUpperCase();
|
|
23
24
|
* });
|
|
@@ -32,4 +33,6 @@ exports.PrintTypeEvents = {
|
|
|
32
33
|
BEFORE_PRINT_TYPE: "print:beforePrintType",
|
|
33
34
|
/** Emitted after generating the full type documentation (output can be modified) */
|
|
34
35
|
AFTER_PRINT_TYPE: "print:afterPrintType",
|
|
36
|
+
/** Emitted before composing page sections (can modify section content) */
|
|
37
|
+
BEFORE_COMPOSE_PAGE_TYPE: "print:beforeComposePageType",
|
|
35
38
|
};
|