@graphql-markdown/docusaurus 1.19.0 → 1.20.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/package.json +6 -3
- package/src/index.js +12 -2
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.20.1",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "src/index.js",
|
|
11
11
|
"repository": {
|
|
@@ -31,8 +31,11 @@
|
|
|
31
31
|
"stryker": "stryker run"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@graphql-markdown/core": "^1.
|
|
35
|
-
"@graphql-markdown/printer-legacy": "^1.4.
|
|
34
|
+
"@graphql-markdown/core": "^1.6.1",
|
|
35
|
+
"@graphql-markdown/printer-legacy": "^1.4.1"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@docusaurus/logger": "*"
|
|
36
39
|
},
|
|
37
40
|
"directories": {
|
|
38
41
|
"test": "tests"
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/* istanbul ignore file */
|
|
2
2
|
const { generateDocFromSchema, config } = require("@graphql-markdown/core");
|
|
3
|
+
const { logger: Logger } = require("@graphql-markdown/utils");
|
|
3
4
|
|
|
4
5
|
const NAME = "docusaurus-graphql-doc-generator";
|
|
5
6
|
const COMMAND = "graphql-to-doc";
|
|
6
7
|
const DESCRIPTION = "Generate GraphQL Schema Documentation";
|
|
7
8
|
const DEFAULT_ID = "default";
|
|
8
9
|
|
|
10
|
+
// eslint-disable-next-line node/no-missing-require
|
|
11
|
+
const LOGGER_MODULE = require.resolve("@docusaurus/logger");
|
|
12
|
+
|
|
13
|
+
Logger.setInstance(LOGGER_MODULE);
|
|
14
|
+
|
|
9
15
|
module.exports = function pluginGraphQLDocGenerator(_, configOptions) {
|
|
10
16
|
const isDefaultId = configOptions.id === DEFAULT_ID;
|
|
11
17
|
|
|
@@ -48,10 +54,14 @@ module.exports = function pluginGraphQLDocGenerator(_, configOptions) {
|
|
|
48
54
|
)
|
|
49
55
|
.option("--pretty", "Prettify generated files")
|
|
50
56
|
.action(async (cliOptions) => {
|
|
51
|
-
const options = config.buildConfig(
|
|
57
|
+
const options = config.buildConfig(
|
|
58
|
+
configOptions,
|
|
59
|
+
cliOptions,
|
|
60
|
+
configOptions.id,
|
|
61
|
+
);
|
|
52
62
|
await generateDocFromSchema({
|
|
53
63
|
...options,
|
|
54
|
-
loggerModule:
|
|
64
|
+
loggerModule: LOGGER_MODULE,
|
|
55
65
|
});
|
|
56
66
|
});
|
|
57
67
|
},
|