@graphql-markdown/core 1.6.0 → 1.6.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/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.6.0",
8
+ "version": "1.6.2",
9
9
  "license": "MIT",
10
10
  "main": "src/index.js",
11
11
  "repository": {
@@ -29,13 +29,12 @@
29
29
  "stryker": "stryker run"
30
30
  },
31
31
  "dependencies": {
32
- "@graphql-markdown/utils": "^1.5.0"
32
+ "@graphql-markdown/utils": "^1.5.1"
33
33
  },
34
34
  "peerDependencies": {
35
- "@graphql-markdown/diff": "^1.0.13",
36
- "@graphql-markdown/printer-legacy": "^1.4.0",
37
- "graphql-config": "^5.0.2",
38
- "prettier": "^2.8"
35
+ "@graphql-markdown/diff": "^1.0.14",
36
+ "@graphql-markdown/printer-legacy": "^1.4.2",
37
+ "graphql-config": "^5.0.2"
39
38
  },
40
39
  "peerDependenciesMeta": {
41
40
  "@graphql-markdown/printer-legacy": {
@@ -46,15 +45,8 @@
46
45
  },
47
46
  "graphql-config": {
48
47
  "optional": true
49
- },
50
- "prettier": {
51
- "optional": true
52
48
  }
53
49
  },
54
- "devDependencies": {
55
- "@graphql-markdown/printer-legacy": "^1.1.3",
56
- "graphql-config": "^5.0.2"
57
- },
58
50
  "directories": {
59
51
  "test": "tests"
60
52
  },
package/src/config.js CHANGED
@@ -26,6 +26,7 @@ const DEFAULT_OPTIONS = {
26
26
  pretty: false,
27
27
  printer: "@graphql-markdown/printer-legacy",
28
28
  printTypeOptions: {
29
+ codeSection: true,
29
30
  deprecated: "default",
30
31
  parentTypePrefix: true,
31
32
  relatedTypeSection: true,
@@ -113,14 +114,15 @@ function getDocOptions(cliOpts, configOptions) {
113
114
 
114
115
  function gePrintTypeOptions(cliOpts, configOptions) {
115
116
  return {
116
- parentTypePrefix: !cliOpts.noParentType && configOptions.parentTypePrefix,
117
- relatedTypeSection:
118
- !cliOpts.noRelatedType && configOptions.relatedTypeSection,
119
- typeBadges: !cliOpts.noTypeBadges && configOptions.typeBadges,
117
+ codeSection: !cliOpts.noCode && configOptions.codeSection,
120
118
  deprecated:
121
119
  cliOpts.deprecated ??
122
120
  configOptions.deprecated ??
123
121
  DEFAULT_OPTIONS.printTypeOptions.deprecated,
122
+ parentTypePrefix: !cliOpts.noParentType && configOptions.parentTypePrefix,
123
+ relatedTypeSection:
124
+ !cliOpts.noRelatedType && configOptions.relatedTypeSection,
125
+ typeBadges: !cliOpts.noTypeBadges && configOptions.typeBadges,
124
126
  };
125
127
  }
126
128
 
package/src/renderer.js CHANGED
@@ -130,7 +130,8 @@ module.exports = class Renderer {
130
130
 
131
131
  await saveFile(
132
132
  filePath,
133
- this.prettify ? prettifyMarkdown(content) : content,
133
+ content,
134
+ this.prettify ? prettifyMarkdown : undefined,
134
135
  );
135
136
 
136
137
  const pagePath = path.relative(this.outputDir, filePath);
@@ -167,7 +168,8 @@ module.exports = ${JSON.stringify(sidebar, null, 2)};
167
168
  const filePath = path.join(this.outputDir, SIDEBAR);
168
169
  await saveFile(
169
170
  filePath,
170
- this.prettify ? prettifyJavascript(jsonSidebar) : jsonSidebar,
171
+ jsonSidebar,
172
+ this.prettify ? prettifyJavascript : undefined,
171
173
  );
172
174
 
173
175
  return path.relative("./", filePath);