@graphql-markdown/core 1.12.1 → 1.12.2

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/config.d.ts CHANGED
@@ -16,6 +16,9 @@ export declare enum DeprecatedOption {
16
16
  export declare const DOCS_URL: "https://graphql-markdown.dev/docs";
17
17
  export declare const PACKAGE_NAME: "@graphql-markdown/docusaurus";
18
18
  export declare const ASSET_HOMEPAGE_LOCATION: string;
19
+ export declare const DEFAULT_HIERARCHY: {
20
+ api: {};
21
+ };
19
22
  export declare const DEFAULT_OPTIONS: Readonly<Pick<ConfigOptions, "customDirective" | "groupByDirective" | "loaders"> & Required<Omit<ConfigOptions, "customDirective" | "groupByDirective" | "loaders" | "printTypeOptions">>> & {
20
23
  printTypeOptions: Required<Omit<ConfigPrintTypeOptions, "hierarchy">> & {
21
24
  hierarchy: Required<Pick<TypeHierarchyObjectType, TypeHierarchy.API>>;
package/dist/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildConfig = exports.parseGroupByOption = exports.getPrintTypeOptions = exports.parseDeprecatedPrintTypeOptions = exports.getTypeHierarchyOption = exports.getDocOptions = exports.parseDeprecatedDocOptions = exports.getDiffMethod = exports.getCustomDirectives = exports.getVisibilityDirectives = exports.getSkipDocDirectives = exports.getOnlyDocDirectives = exports.getDocDirective = exports.DEFAULT_OPTIONS = exports.ASSET_HOMEPAGE_LOCATION = exports.PACKAGE_NAME = exports.DOCS_URL = exports.DeprecatedOption = exports.DiffMethod = exports.TypeHierarchy = void 0;
3
+ exports.buildConfig = exports.parseGroupByOption = exports.getPrintTypeOptions = exports.parseDeprecatedPrintTypeOptions = exports.getTypeHierarchyOption = exports.getDocOptions = exports.parseDeprecatedDocOptions = exports.getDiffMethod = 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;
4
4
  const node_path_1 = require("node:path");
5
5
  const node_os_1 = require("node:os");
6
6
  const graphql_config_1 = require("./graphql-config");
@@ -25,6 +25,7 @@ var DeprecatedOption;
25
25
  exports.DOCS_URL = "https://graphql-markdown.dev/docs";
26
26
  exports.PACKAGE_NAME = "@graphql-markdown/docusaurus";
27
27
  exports.ASSET_HOMEPAGE_LOCATION = (0, node_path_1.join)(__dirname, "..", "assets", "generated.md");
28
+ exports.DEFAULT_HIERARCHY = { [TypeHierarchy.API]: {} };
28
29
  exports.DEFAULT_OPTIONS = {
29
30
  id: "default",
30
31
  baseURL: "schema",
@@ -49,7 +50,6 @@ exports.DEFAULT_OPTIONS = {
49
50
  parentTypePrefix: true,
50
51
  relatedTypeSection: true,
51
52
  typeBadges: true,
52
- hierarchy: { [TypeHierarchy.API]: {} },
53
53
  },
54
54
  rootPath: "./docs",
55
55
  schema: "./schema.graphql",
@@ -189,9 +189,7 @@ const getTypeHierarchyOption = (cliOption, configOption) => {
189
189
  throw new Error(`Hierarchy option mismatch in CLI flag '${strCliHierarchy}' and config '${strConfigHierarchy}'`);
190
190
  }
191
191
  }
192
- return (cliHierarchy ??
193
- configHierarchy ??
194
- exports.DEFAULT_OPTIONS.printTypeOptions.hierarchy);
192
+ return cliHierarchy ?? configHierarchy ?? exports.DEFAULT_HIERARCHY;
195
193
  };
196
194
  exports.getTypeHierarchyOption = getTypeHierarchyOption;
197
195
  const parseDeprecatedPrintTypeOptions = (cliOpts, configOptions) => {
package/dist/diff.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.hasChanges = void 0;
27
37
  const logger_1 = require("@graphql-markdown/logger");
package/dist/generator.js CHANGED
@@ -15,17 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.generateDocFromSchema = void 0;
27
37
  const logger_1 = __importStar(require("@graphql-markdown/logger"));
28
38
  const graphql_1 = require("@graphql-markdown/graphql");
39
+ const utils_1 = require("@graphql-markdown/utils");
29
40
  const config_1 = require("./config");
30
41
  const diff_1 = require("./diff");
31
42
  const printer_1 = require("./printer");
@@ -44,7 +55,7 @@ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, doc
44
55
  if (diffMethod !== config_1.DiffMethod.NONE) {
45
56
  const changed = await (0, diff_1.hasChanges)(schema, tmpDir, diffMethod);
46
57
  if (!changed) {
47
- (0, logger_1.log)(`No changes detected in schema "${String(schemaLocation)}".`);
58
+ (0, logger_1.log)(`No changes detected in schema "${(0, utils_1.toString)(schemaLocation)}".`);
48
59
  }
49
60
  }
50
61
  const [onlyDocDirectives, skipDocDirectives] = [
@@ -93,6 +104,6 @@ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, doc
93
104
  await renderer.renderHomepage(homepageLocation);
94
105
  const duration = (Number(process.hrtime.bigint() - start) / NS_PER_SEC).toFixed(SEC_DECIMALS);
95
106
  (0, logger_1.log)(`Documentation successfully generated in "${outputDir}" with base URL "${baseURL}".`, "success");
96
- (0, logger_1.log)(`${pages.flat().length} pages generated in ${duration}s from schema "${String(schemaLocation)}".`);
107
+ (0, logger_1.log)(`${pages.flat().length} pages generated in ${duration}s from schema "${(0, utils_1.toString)(schemaLocation)}".`);
97
108
  };
98
109
  exports.generateDocFromSchema = generateDocFromSchema;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.loadConfiguration = exports.setLoaderOptions = exports.graphQLConfigExtension = exports.EXTENSION_NAME = void 0;
27
37
  const logger_1 = require("@graphql-markdown/logger");
package/dist/printer.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
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
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.getPrinter = void 0;
27
37
  const getPrinter = async (printerModule, config, options) => {
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.12.1",
8
+ "version": "1.12.2",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -63,18 +63,18 @@
63
63
  "docs": "typedoc"
64
64
  },
65
65
  "dependencies": {
66
- "@graphql-markdown/graphql": "^1.1.4",
66
+ "@graphql-markdown/graphql": "^1.1.5",
67
67
  "@graphql-markdown/logger": "^1.0.5",
68
- "@graphql-markdown/utils": "^1.7.0"
68
+ "@graphql-markdown/utils": "^1.7.1"
69
69
  },
70
70
  "peerDependencies": {
71
- "@graphql-markdown/diff": "^1.1.8",
72
- "@graphql-markdown/helpers": "^1.0.7",
73
- "@graphql-markdown/printer-legacy": "^1.9.0",
71
+ "@graphql-markdown/diff": "^1.1.9",
72
+ "@graphql-markdown/helpers": "^1.0.8",
73
+ "@graphql-markdown/printer-legacy": "^1.9.1",
74
74
  "graphql-config": "^5.1.0"
75
75
  },
76
76
  "devDependencies": {
77
- "@graphql-markdown/types": "^1.4.0"
77
+ "@graphql-markdown/types": "^1.4.2"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "@graphql-markdown/printer-legacy": {