@graphql-markdown/core 1.23.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/event-map.d.ts +1 -0
- package/dist/event-map.d.ts.map +1 -1
- package/dist/event-map.js +2 -0
- package/dist/events/config-build-events.d.ts +13 -0
- package/dist/events/config-build-events.d.ts.map +1 -0
- package/dist/events/config-build-events.js +15 -0
- package/dist/events/config-build.d.ts +21 -0
- package/dist/events/config-build.d.ts.map +1 -0
- package/dist/events/config-build.js +20 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +5 -1
- package/dist/generator.d.ts +1 -1
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +7 -3
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.js +9 -2
- package/package.json +9 -9
package/dist/event-map.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* They are pure transformations handled via the Formatter interface, not events.
|
|
7
7
|
*/
|
|
8
8
|
export declare const EVENT_CALLBACK_MAP: {
|
|
9
|
+
readonly "config:afterBuild": "afterConfigBuildHook";
|
|
9
10
|
readonly "schema:beforeLoad": "beforeLoadSchemaHook";
|
|
10
11
|
readonly "schema:afterLoad": "afterLoadSchemaHook";
|
|
11
12
|
readonly "diff:beforeCheck": "beforeCheckDiffHook";
|
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":"
|
|
1
|
+
{"version":3,"file":"event-map.d.ts","sourceRoot":"","sources":["../src/event-map.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;kCACI,sBAAsB;kCAC3B,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
|
@@ -9,6 +9,7 @@ exports.EVENT_CALLBACK_MAP = void 0;
|
|
|
9
9
|
*
|
|
10
10
|
* @packageDocumentation
|
|
11
11
|
*/
|
|
12
|
+
const config_build_events_1 = require("./events/config-build-events");
|
|
12
13
|
const schema_events_1 = require("./events/schema-events");
|
|
13
14
|
const diff_events_1 = require("./events/diff-events");
|
|
14
15
|
const render_root_types_events_1 = require("./events/render-root-types-events");
|
|
@@ -25,6 +26,7 @@ const print_type_events_1 = require("./events/print-type-events");
|
|
|
25
26
|
* They are pure transformations handled via the Formatter interface, not events.
|
|
26
27
|
*/
|
|
27
28
|
exports.EVENT_CALLBACK_MAP = {
|
|
29
|
+
[config_build_events_1.ConfigBuildEvents.AFTER_BUILD]: "afterConfigBuildHook",
|
|
28
30
|
[schema_events_1.SchemaEvents.BEFORE_LOAD]: "beforeLoadSchemaHook",
|
|
29
31
|
[schema_events_1.SchemaEvents.AFTER_LOAD]: "afterLoadSchemaHook",
|
|
30
32
|
[diff_events_1.DiffEvents.BEFORE_CHECK]: "beforeCheckDiffHook",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config build event constants.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Event name fired once after the final configuration has been resolved.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ConfigBuildEvents: {
|
|
10
|
+
/** Emitted after the final Options object has been resolved, before generation starts */
|
|
11
|
+
readonly AFTER_BUILD: "config:afterBuild";
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=config-build-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-build-events.d.ts","sourceRoot":"","sources":["../../src/events/config-build-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B,yFAAyF;aACzF,WAAW,EAAE,mBAAmB;CACxB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Config build event constants.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ConfigBuildEvents = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Event name fired once after the final configuration has been resolved.
|
|
11
|
+
*/
|
|
12
|
+
exports.ConfigBuildEvents = {
|
|
13
|
+
/** Emitted after the final Options object has been resolved, before generation starts */
|
|
14
|
+
AFTER_BUILD: "config:afterBuild",
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config build event class.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
import type { Options } from "@graphql-markdown/types";
|
|
7
|
+
import type { CancellableEventOptions } from "@graphql-markdown/utils";
|
|
8
|
+
import { DataEvent } from "@graphql-markdown/utils";
|
|
9
|
+
/**
|
|
10
|
+
* Event emitted after the final configuration has been resolved.
|
|
11
|
+
*
|
|
12
|
+
* @category Events
|
|
13
|
+
*/
|
|
14
|
+
export declare class ConfigBuildEvent extends DataEvent<{
|
|
15
|
+
config: Options;
|
|
16
|
+
}> {
|
|
17
|
+
constructor(data: {
|
|
18
|
+
config: Options;
|
|
19
|
+
}, options?: CancellableEventOptions);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=config-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-build.d.ts","sourceRoot":"","sources":["../../src/events/config-build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,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,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;IACA,YACE,IAAI,EAAE;QACJ,MAAM,EAAE,OAAO,CAAC;KACjB,EACD,OAAO,CAAC,EAAE,uBAAuB,EAGlC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Config build event class.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ConfigBuildEvent = void 0;
|
|
9
|
+
const utils_1 = require("@graphql-markdown/utils");
|
|
10
|
+
/**
|
|
11
|
+
* Event emitted after the final configuration has been resolved.
|
|
12
|
+
*
|
|
13
|
+
* @category Events
|
|
14
|
+
*/
|
|
15
|
+
class ConfigBuildEvent extends utils_1.DataEvent {
|
|
16
|
+
constructor(data, options) {
|
|
17
|
+
super(data, options);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.ConfigBuildEvent = ConfigBuildEvent;
|
package/dist/events/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
+
export { ConfigBuildEvents } from "./config-build-events";
|
|
6
7
|
export { SchemaEvents } from "./schema-events";
|
|
7
8
|
export { DiffEvents } from "./diff-events";
|
|
8
9
|
export { RenderRootTypesEvents } from "./render-root-types-events";
|
|
@@ -11,6 +12,7 @@ export { RenderFilesEvents } from "./render-files-events";
|
|
|
11
12
|
export { RenderTypeEntitiesEvents } from "./render-type-entities-events";
|
|
12
13
|
export { GenerateIndexMetafileEvents } from "./generate-index-metafile-events";
|
|
13
14
|
export { PrintTypeEvents } from "./print-type-events";
|
|
15
|
+
export { ConfigBuildEvent } from "./config-build";
|
|
14
16
|
export { SchemaEvent } from "./schema-load";
|
|
15
17
|
export { DiffCheckEvent } from "./diff-check";
|
|
16
18
|
export { RenderRootTypesEvent } from "./render-root-types";
|
|
@@ -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,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,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;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,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"}
|
package/dist/events/index.js
CHANGED
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
8
|
+
exports.GenerateIndexMetafileEvent = exports.RenderTypeEntitiesEvent = exports.RenderFilesEvent = exports.RenderHomepageEvent = exports.RenderRootTypesEvent = exports.DiffCheckEvent = exports.SchemaEvent = exports.ConfigBuildEvent = exports.PrintTypeEvents = exports.GenerateIndexMetafileEvents = exports.RenderTypeEntitiesEvents = exports.RenderFilesEvents = exports.RenderHomepageEvents = exports.RenderRootTypesEvents = exports.DiffEvents = exports.SchemaEvents = exports.ConfigBuildEvents = void 0;
|
|
9
9
|
// Event constants
|
|
10
|
+
var config_build_events_1 = require("./config-build-events");
|
|
11
|
+
Object.defineProperty(exports, "ConfigBuildEvents", { enumerable: true, get: function () { return config_build_events_1.ConfigBuildEvents; } });
|
|
10
12
|
var schema_events_1 = require("./schema-events");
|
|
11
13
|
Object.defineProperty(exports, "SchemaEvents", { enumerable: true, get: function () { return schema_events_1.SchemaEvents; } });
|
|
12
14
|
var diff_events_1 = require("./diff-events");
|
|
@@ -25,6 +27,8 @@ Object.defineProperty(exports, "GenerateIndexMetafileEvents", { enumerable: true
|
|
|
25
27
|
var print_type_events_1 = require("./print-type-events");
|
|
26
28
|
Object.defineProperty(exports, "PrintTypeEvents", { enumerable: true, get: function () { return print_type_events_1.PrintTypeEvents; } });
|
|
27
29
|
// Event classes
|
|
30
|
+
var config_build_1 = require("./config-build");
|
|
31
|
+
Object.defineProperty(exports, "ConfigBuildEvent", { enumerable: true, get: function () { return config_build_1.ConfigBuildEvent; } });
|
|
28
32
|
var schema_load_1 = require("./schema-load");
|
|
29
33
|
Object.defineProperty(exports, "SchemaEvent", { enumerable: true, get: function () { return schema_load_1.SchemaEvent; } });
|
|
30
34
|
var diff_check_1 = require("./diff-check");
|
package/dist/generator.d.ts
CHANGED
|
@@ -100,5 +100,5 @@ export declare const resolveSkipAndOnlyDirectives: (onlyDocDirective: Maybe<Dire
|
|
|
100
100
|
* @param options - Complete configuration for the documentation generation
|
|
101
101
|
* @returns Promise that resolves when documentation is fully generated
|
|
102
102
|
*/
|
|
103
|
-
export declare const generateDocFromSchema: (
|
|
103
|
+
export declare const generateDocFromSchema: (options: GeneratorOptions) => Promise<void>;
|
|
104
104
|
//# sourceMappingURL=generator.d.ts.map
|
package/dist/generator.d.ts.map
CHANGED
|
@@ -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;
|
|
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;AAiEjC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,cACb,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,KACrC,OAAO,CAAC,OAAO,CAYjB,CAAC;AAiBF;;;;;;;;;;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;AAEH,eAAO,MAAM,sBAAsB,WACzB,aAAa,kBACL,MAAM,cACV,KAAK,CAAC,cAAc,CAAC,UACzB,MAAM,KACb,OAAO,CAAC,OAAO,CAWjB,CAAC;AAEF;;;;;;;;;;;;GAYG;AAEH,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,YACvB,gBAAgB,KACxB,OAAO,CAAC,IAAI,CA+Pd,CAAC"}
|
package/dist/generator.js
CHANGED
|
@@ -278,15 +278,19 @@ exports.resolveSkipAndOnlyDirectives = resolveSkipAndOnlyDirectives;
|
|
|
278
278
|
* @param options - Complete configuration for the documentation generation
|
|
279
279
|
* @returns Promise that resolves when documentation is fully generated
|
|
280
280
|
*/
|
|
281
|
-
const generateDocFromSchema = async (
|
|
281
|
+
const generateDocFromSchema = async (options) => {
|
|
282
282
|
const start = process.hrtime.bigint();
|
|
283
|
-
await (0, logger_1.default)(loggerModule);
|
|
284
|
-
const mdxModule = await (0, exports.loadMDXModule)(formatter);
|
|
283
|
+
await (0, logger_1.default)(options.loggerModule);
|
|
284
|
+
const mdxModule = await (0, exports.loadMDXModule)(options.formatter);
|
|
285
285
|
// Register MDX lifecycle event handlers if mdxModule loaded successfully
|
|
286
286
|
// This must be called BEFORE getEvents() because it resets the singleton
|
|
287
287
|
(0, event_handlers_1.registerMDXEventHandlers)(mdxModule);
|
|
288
288
|
// Get events AFTER registration (registerMDXEventHandlers resets and recreates the singleton)
|
|
289
289
|
const events = (0, event_emitter_1.getEvents)();
|
|
290
|
+
// Emitted before destructuring `options` below, so a hook that mutates
|
|
291
|
+
// `event.data.config` (same object reference as `options`) is picked up.
|
|
292
|
+
await events.emitAsync(events_1.ConfigBuildEvents.AFTER_BUILD, new events_1.ConfigBuildEvent({ config: options }));
|
|
293
|
+
const { baseURL, customDirective, decorators, diffMethod, docOptions, force, groupByDirective, homepageLocation, linkRoot, loaders: loadersList, metatags, onlyDocDirective, outputAdapter, outputDir, prettify, printTypeOptions, schemaLocation, skipDocDirective, tmpDir, } = options;
|
|
290
294
|
await events.emitAsync(events_1.SchemaEvents.BEFORE_LOAD, new events_1.SchemaEvent({
|
|
291
295
|
schemaLocation: schemaLocation,
|
|
292
296
|
}));
|
package/dist/renderer.d.ts.map
CHANGED
|
@@ -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,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EAGb,MAAM,yBAAyB,CAAC;AA0FjC;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAG5C,CAAC;AAEX;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,iBAAiB,SACtB,OAAO,WACJ,KAAK,CAAC,oBAAoB,GAAG,OAAO,CAAC,KAC7C,MAMF,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;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,cAAe,MAAM,UAAU,KAAK,EAAE,KAAG,I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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW,+FASrB,eAAe,KAAG,OAAO,CAAC,YAAY,CAAC,OAAO,QAAQ,CAAC,CAezD,CAAC"}
|
package/dist/renderer.js
CHANGED
|
@@ -478,7 +478,15 @@ class Renderer {
|
|
|
478
478
|
// NOSONAR - pattern is safe, hyphen in character class doesn't cause backtracking
|
|
479
479
|
const PageRegex = /(?<category>[a-z0-9-]+)[\\/]+(?<pageId>[a-z0-9-]+)\.mdx?$/i; // NOSONAR
|
|
480
480
|
const PageRegexFlat = /(?<pageId>[a-z0-9-]+)\.mdx?$/i; // NOSONAR
|
|
481
|
-
const
|
|
481
|
+
const isFlat = isHierarchy(this.options, config_1.TypeHierarchy.FLAT);
|
|
482
|
+
// Flat hierarchy has no folders to keep same-named entities of different
|
|
483
|
+
// kinds apart (a `type User` and a `Query.user` field both slugify to
|
|
484
|
+
// "user") — prefixing with `entity` (the `SchemaEntity` root type this
|
|
485
|
+
// came from, e.g. "objects" vs "queries") keeps every flat filename
|
|
486
|
+
// unique the same way the folder structure already does for "api"/
|
|
487
|
+
// "entity" hierarchy. `link.ts`'s `toLink` builds the matching prefix for
|
|
488
|
+
// cross-references under flat hierarchy — the two must stay in sync.
|
|
489
|
+
const fileName = isFlat && entity ? `${entity}-${(0, utils_1.slugify)(name)}` : (0, utils_1.slugify)(name);
|
|
482
490
|
const filePath = (0, node_path_1.join)((0, node_path_1.normalize)(dirPath), `${fileName}${this.mdxExtension}`);
|
|
483
491
|
let content;
|
|
484
492
|
try {
|
|
@@ -523,7 +531,6 @@ class Renderer {
|
|
|
523
531
|
}
|
|
524
532
|
await this.writeOutput(filePath, content);
|
|
525
533
|
const pagePath = (0, node_path_1.relative)(this.outputDir, filePath);
|
|
526
|
-
const isFlat = isHierarchy(this.options, config_1.TypeHierarchy.FLAT);
|
|
527
534
|
const page = isFlat
|
|
528
535
|
? PageRegexFlat.exec(pagePath)
|
|
529
536
|
: PageRegex.exec(pagePath);
|
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.
|
|
8
|
+
"version": "1.24.1",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -73,18 +73,18 @@
|
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@fastify/deepmerge": "^3.2.1",
|
|
76
|
-
"@graphql-markdown/graphql": "",
|
|
77
|
-
"@graphql-markdown/logger": "",
|
|
78
|
-
"@graphql-markdown/printer-legacy": "",
|
|
79
|
-
"@graphql-markdown/types": "",
|
|
80
|
-
"@graphql-markdown/utils": ""
|
|
76
|
+
"@graphql-markdown/graphql": "^1.3.2",
|
|
77
|
+
"@graphql-markdown/logger": "^1.1.2",
|
|
78
|
+
"@graphql-markdown/printer-legacy": "^1.19.1",
|
|
79
|
+
"@graphql-markdown/types": "^1.16.1",
|
|
80
|
+
"@graphql-markdown/utils": "^1.13.3"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@graphql-markdown/tooling-config": ""
|
|
83
|
+
"@graphql-markdown/tooling-config": "^1.0.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@graphql-markdown/diff": "",
|
|
87
|
-
"@graphql-markdown/helpers": "",
|
|
86
|
+
"@graphql-markdown/diff": "^1.1.21",
|
|
87
|
+
"@graphql-markdown/helpers": "^1.2.2",
|
|
88
88
|
"graphql-config": "5.1.6"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|