@graphql-markdown/core 1.9.0 → 1.10.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/dist/config.d.ts +2 -7
- package/dist/config.js +3 -0
- package/dist/generator.js +2 -2
- package/dist/graphql-config.js +1 -1
- package/package.json +6 -6
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CliOptions, ConfigDocOptions, ConfigOptions, ConfigPrintTypeOptions, CustomDirective, DeprecatedCliOptions, DeprecatedConfigDocOptions, DirectiveName, GroupByDirectiveOptions,
|
|
1
|
+
import type { CliOptions, ConfigDocOptions, ConfigOptions, ConfigPrintTypeOptions, CustomDirective, DeprecatedCliOptions, DeprecatedConfigDocOptions, DirectiveName, GroupByDirectiveOptions, Maybe, Options, TypeDiffMethod } from "@graphql-markdown/types";
|
|
2
2
|
export declare enum DiffMethod {
|
|
3
3
|
NONE = "NONE",
|
|
4
4
|
FORCE = "FORCE"
|
|
@@ -11,12 +11,7 @@ export declare enum DeprecatedOption {
|
|
|
11
11
|
export declare const DOCS_URL: "https://graphql-markdown.github.io/docs";
|
|
12
12
|
export declare const PACKAGE_NAME: "@graphql-markdown/docusaurus";
|
|
13
13
|
export declare const ASSET_HOMEPAGE_LOCATION: string;
|
|
14
|
-
export declare const DEFAULT_OPTIONS:
|
|
15
|
-
customDirective: Maybe<CustomDirective>;
|
|
16
|
-
groupByDirective: Maybe<GroupByDirectiveOptions>;
|
|
17
|
-
loaders: Maybe<LoaderOption>;
|
|
18
|
-
metatags: Record<string, string>[];
|
|
19
|
-
};
|
|
14
|
+
export declare const DEFAULT_OPTIONS: Readonly<Pick<ConfigOptions, "customDirective" | "groupByDirective" | "loaders"> & Required<Omit<ConfigOptions, "customDirective" | "groupByDirective" | "loaders">>>;
|
|
20
15
|
export declare const getDocDirective: (name: Maybe<DirectiveName>) => DirectiveName;
|
|
21
16
|
export declare const getOnlyDocDirectives: (cliOpts: Maybe<CliOptions>, configFileOpts: Maybe<Pick<ConfigOptions, "onlyDocDirective">>) => DirectiveName[];
|
|
22
17
|
export declare const getSkipDocDirectives: (cliOpts: Maybe<CliOptions>, configFileOpts: Maybe<Pick<ConfigOptions, "printTypeOptions" | "skipDocDirective">>) => DirectiveName[];
|
package/dist/config.js
CHANGED
|
@@ -38,6 +38,7 @@ exports.DEFAULT_OPTIONS = {
|
|
|
38
38
|
printTypeOptions: {
|
|
39
39
|
codeSection: true,
|
|
40
40
|
deprecated: DeprecatedOption.DEFAULT,
|
|
41
|
+
exampleSection: false,
|
|
41
42
|
parentTypePrefix: true,
|
|
42
43
|
relatedTypeSection: true,
|
|
43
44
|
typeBadges: true,
|
|
@@ -160,6 +161,8 @@ const getPrintTypeOptions = (cliOpts, configOptions) => {
|
|
|
160
161
|
deprecated: (cliOpts?.deprecated ??
|
|
161
162
|
configOptions?.deprecated ??
|
|
162
163
|
exports.DEFAULT_OPTIONS.printTypeOptions.deprecated).toLocaleLowerCase(),
|
|
164
|
+
exampleSection: (!cliOpts?.noExample && configOptions?.exampleSection) ??
|
|
165
|
+
exports.DEFAULT_OPTIONS.printTypeOptions.exampleSection,
|
|
163
166
|
parentTypePrefix: (!cliOpts?.noParentType && configOptions?.parentTypePrefix) ??
|
|
164
167
|
exports.DEFAULT_OPTIONS.printTypeOptions.parentTypePrefix,
|
|
165
168
|
relatedTypeSection: (!cliOpts?.noRelatedType && configOptions?.relatedTypeSection) ??
|
package/dist/generator.js
CHANGED
|
@@ -59,8 +59,8 @@ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, doc
|
|
|
59
59
|
});
|
|
60
60
|
const renderer = new renderer_1.Renderer(printer, outputDir, baseURL, groups, prettify, {
|
|
61
61
|
...docOptions,
|
|
62
|
-
deprecated: printTypeOptions
|
|
63
|
-
useApiGroup: printTypeOptions
|
|
62
|
+
deprecated: printTypeOptions?.deprecated,
|
|
63
|
+
useApiGroup: printTypeOptions?.useApiGroup,
|
|
64
64
|
});
|
|
65
65
|
const pages = await Promise.all(Object.keys(rootTypes).map(async (typeName) => {
|
|
66
66
|
return renderer.renderRootTypes(typeName, rootTypes[typeName]);
|
package/dist/graphql-config.js
CHANGED
|
@@ -84,7 +84,7 @@ const loadConfiguration = async (id, options, { throwOnMissing, throwOnEmpty } =
|
|
|
84
84
|
if (typeof projectConfig.schema === "object") {
|
|
85
85
|
projectConfig.schema = Object.keys(schema)[0];
|
|
86
86
|
if (typeof projectConfig.loaders !== "undefined") {
|
|
87
|
-
projectConfig.loaders = (0, exports.setLoaderOptions)(projectConfig.loaders, Object.values(schema)[0]);
|
|
87
|
+
projectConfig.loaders = (0, exports.setLoaderOptions)(projectConfig.loaders ?? {}, Object.values(schema)[0]);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
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.10.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -62,18 +62,18 @@
|
|
|
62
62
|
"clean": "rm -rf ./dist"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@graphql-markdown/graphql": "^1.1.
|
|
65
|
+
"@graphql-markdown/graphql": "^1.1.1",
|
|
66
66
|
"@graphql-markdown/logger": "^1.0.2",
|
|
67
67
|
"@graphql-markdown/utils": "^1.6.3"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@graphql-markdown/diff": "^1.1.
|
|
71
|
-
"@graphql-markdown/helpers": "^1.0.
|
|
72
|
-
"@graphql-markdown/printer-legacy": "^1.
|
|
70
|
+
"@graphql-markdown/diff": "^1.1.4",
|
|
71
|
+
"@graphql-markdown/helpers": "^1.0.4",
|
|
72
|
+
"@graphql-markdown/printer-legacy": "^1.8.0",
|
|
73
73
|
"graphql-config": "^5.0.3"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@graphql-markdown/types": "^1.
|
|
76
|
+
"@graphql-markdown/types": "^1.3.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependenciesMeta": {
|
|
79
79
|
"@graphql-markdown/printer-legacy": {
|