@graphql-markdown/core 1.12.2 → 1.13.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 +4 -10
- package/dist/config.js +10 -45
- package/dist/generator.js +5 -1
- package/package.json +3 -3
package/dist/config.d.ts
CHANGED
|
@@ -33,16 +33,10 @@ export declare const getVisibilityDirectives: (cliOpts: Maybe<CliOptions>, confi
|
|
|
33
33
|
};
|
|
34
34
|
export declare const getCustomDirectives: (customDirectiveOptions: Maybe<CustomDirective>, skipDocDirective?: Maybe<DirectiveName[]>) => Maybe<CustomDirective>;
|
|
35
35
|
export declare const getDiffMethod: (diff: TypeDiffMethod, force?: boolean) => TypeDiffMethod;
|
|
36
|
-
export declare const parseDeprecatedDocOptions: (
|
|
37
|
-
|
|
38
|
-
pagination_prev: null;
|
|
39
|
-
hide_table_of_contents: boolean;
|
|
40
|
-
}>;
|
|
41
|
-
export declare const getDocOptions: (cliOpts?: Maybe<CliOptions & DeprecatedCliOptions>, configOptions?: Maybe<ConfigDocOptions & DeprecatedConfigDocOptions>) => Required<ConfigDocOptions>;
|
|
36
|
+
export declare const parseDeprecatedDocOptions: (_cliOpts: Maybe<Omit<DeprecatedCliOptions, "never">>, _configOptions: Maybe<Omit<DeprecatedConfigDocOptions, "never">>) => Record<string, never>;
|
|
37
|
+
export declare const getDocOptions: (cliOpts?: Maybe<CliOptions & Omit<DeprecatedCliOptions, "never">>, configOptions?: Maybe<ConfigDocOptions & Omit<DeprecatedConfigDocOptions, "never">>) => Required<ConfigDocOptions>;
|
|
42
38
|
export declare const getTypeHierarchyOption: (cliOption?: Maybe<TypeHierarchyValueType>, configOption?: Maybe<TypeHierarchyType>) => Maybe<TypeHierarchyObjectType>;
|
|
43
|
-
export declare const parseDeprecatedPrintTypeOptions: (
|
|
44
|
-
|
|
45
|
-
}>;
|
|
46
|
-
export declare const getPrintTypeOptions: (cliOpts: Maybe<CliOptions & DeprecatedCliOptions>, configOptions: Maybe<ConfigPrintTypeOptions & DeprecatedConfigPrintTypeOptions>) => Required<ConfigPrintTypeOptions>;
|
|
39
|
+
export declare const parseDeprecatedPrintTypeOptions: (_cliOpts: Maybe<Omit<DeprecatedCliOptions, "never">>, _configOptions: Maybe<Omit<DeprecatedConfigPrintTypeOptions, "never">>) => Record<string, never>;
|
|
40
|
+
export declare const getPrintTypeOptions: (cliOpts: Maybe<CliOptions & Omit<DeprecatedCliOptions, "never">>, configOptions: Maybe<ConfigPrintTypeOptions & Omit<DeprecatedConfigPrintTypeOptions, "never">>) => Required<ConfigPrintTypeOptions>;
|
|
47
41
|
export declare const parseGroupByOption: (groupOptions: unknown) => Maybe<GroupByDirectiveOptions>;
|
|
48
42
|
export declare const buildConfig: (configFileOpts: Maybe<ConfigOptions>, cliOpts?: Maybe<CliOptions>, id?: Maybe<string>) => Promise<Options>;
|
package/dist/config.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.buildConfig = exports.parseGroupByOption = exports.getPrintTypeOptions =
|
|
|
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");
|
|
7
|
-
const logger_1 = require("@graphql-markdown/logger");
|
|
8
7
|
var TypeHierarchy;
|
|
9
8
|
(function (TypeHierarchy) {
|
|
10
9
|
TypeHierarchy["API"] = "api";
|
|
@@ -126,38 +125,23 @@ const getDiffMethod = (diff, force = false) => {
|
|
|
126
125
|
: diff.toLocaleUpperCase();
|
|
127
126
|
};
|
|
128
127
|
exports.getDiffMethod = getDiffMethod;
|
|
129
|
-
const parseDeprecatedDocOptions = (
|
|
130
|
-
|
|
131
|
-
let pagination;
|
|
132
|
-
if ((typeof cliOpts?.noPagination !== "undefined" && cliOpts.noPagination) ||
|
|
133
|
-
(typeof configOptions?.pagination !== "undefined" &&
|
|
134
|
-
!configOptions.pagination)) {
|
|
135
|
-
pagination = { pagination_next: null, pagination_prev: null };
|
|
136
|
-
(0, logger_1.log)("Doc option `pagination` is deprecated. Use `frontMatter: { pagination_next: null, pagination_prev: null }` instead.", "warn");
|
|
137
|
-
}
|
|
138
|
-
// deprecated, replaced by frontMatter
|
|
139
|
-
let toc;
|
|
140
|
-
if (typeof cliOpts?.noToc !== "undefined" ||
|
|
141
|
-
typeof configOptions?.toc !== "undefined") {
|
|
142
|
-
toc = {
|
|
143
|
-
hide_table_of_contents: cliOpts?.noToc === true || configOptions?.toc === false,
|
|
144
|
-
};
|
|
145
|
-
(0, logger_1.log)("Doc option `toc` is deprecated. Use `frontMatter: { hide_table_of_contents: true | false }` instead.", "warn");
|
|
146
|
-
}
|
|
147
|
-
return { ...pagination, ...toc };
|
|
128
|
+
const parseDeprecatedDocOptions = (_cliOpts, _configOptions) => {
|
|
129
|
+
return {};
|
|
148
130
|
};
|
|
149
131
|
exports.parseDeprecatedDocOptions = parseDeprecatedDocOptions;
|
|
150
132
|
const getDocOptions = (cliOpts, configOptions) => {
|
|
151
133
|
const deprecated = (0, exports.parseDeprecatedDocOptions)(cliOpts, configOptions);
|
|
134
|
+
const index = typeof cliOpts?.index === "boolean"
|
|
135
|
+
? cliOpts.index
|
|
136
|
+
: typeof configOptions?.index === "boolean"
|
|
137
|
+
? configOptions.index
|
|
138
|
+
: exports.DEFAULT_OPTIONS.docOptions.index;
|
|
152
139
|
return {
|
|
153
140
|
frontMatter: {
|
|
154
141
|
...deprecated,
|
|
155
142
|
...configOptions?.frontMatter,
|
|
156
143
|
},
|
|
157
|
-
index
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
159
|
-
(cliOpts?.index || configOptions?.index) ??
|
|
160
|
-
exports.DEFAULT_OPTIONS.docOptions.index,
|
|
144
|
+
index,
|
|
161
145
|
};
|
|
162
146
|
};
|
|
163
147
|
exports.getDocOptions = getDocOptions;
|
|
@@ -192,27 +176,8 @@ const getTypeHierarchyOption = (cliOption, configOption) => {
|
|
|
192
176
|
return cliHierarchy ?? configHierarchy ?? exports.DEFAULT_HIERARCHY;
|
|
193
177
|
};
|
|
194
178
|
exports.getTypeHierarchyOption = getTypeHierarchyOption;
|
|
195
|
-
const parseDeprecatedPrintTypeOptions = (
|
|
196
|
-
|
|
197
|
-
let option;
|
|
198
|
-
if (typeof cliOpts?.noApiGroup !== "undefined" && cliOpts.noApiGroup) {
|
|
199
|
-
option = { hierarchy: TypeHierarchy.ENTITY };
|
|
200
|
-
(0, logger_1.log)("Type option `noApiGroup` is deprecated. Use `hierarchy: 'entity'` instead.", "warn");
|
|
201
|
-
}
|
|
202
|
-
else if (typeof configOptions?.useApiGroup !== "undefined") {
|
|
203
|
-
if (typeof configOptions.useApiGroup === "object") {
|
|
204
|
-
option = {
|
|
205
|
-
hierarchy: { [TypeHierarchy.API]: { ...configOptions.useApiGroup } },
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
option = configOptions.useApiGroup
|
|
210
|
-
? { hierarchy: TypeHierarchy.API }
|
|
211
|
-
: { hierarchy: TypeHierarchy.ENTITY };
|
|
212
|
-
}
|
|
213
|
-
(0, logger_1.log)("Type option `useApiGroup` is deprecated. Use `hierarchy: 'api'` instead.", "warn");
|
|
214
|
-
}
|
|
215
|
-
return { ...option };
|
|
179
|
+
const parseDeprecatedPrintTypeOptions = (_cliOpts, _configOptions) => {
|
|
180
|
+
return {};
|
|
216
181
|
};
|
|
217
182
|
exports.parseDeprecatedPrintTypeOptions = parseDeprecatedPrintTypeOptions;
|
|
218
183
|
const getPrintTypeOptions = (cliOpts, configOptions) => {
|
package/dist/generator.js
CHANGED
|
@@ -86,10 +86,14 @@ const generateDocFromSchema = async ({ baseURL, customDirective, diffMethod, doc
|
|
|
86
86
|
{
|
|
87
87
|
customDirectives,
|
|
88
88
|
groups,
|
|
89
|
+
meta: {
|
|
90
|
+
generatorFrameworkName: docOptions?.generatorFrameworkName,
|
|
91
|
+
generatorFrameworkVersion: docOptions?.generatorFrameworkVersion,
|
|
92
|
+
},
|
|
93
|
+
metatags,
|
|
89
94
|
onlyDocDirectives,
|
|
90
95
|
printTypeOptions,
|
|
91
96
|
skipDocDirectives,
|
|
92
|
-
metatags,
|
|
93
97
|
});
|
|
94
98
|
const renderer = await (0, renderer_1.getRenderer)(printer, outputDir, baseURL, groups, prettify, {
|
|
95
99
|
...docOptions,
|
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.13.0",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@graphql-markdown/diff": "^1.1.9",
|
|
72
72
|
"@graphql-markdown/helpers": "^1.0.8",
|
|
73
|
-
"@graphql-markdown/printer-legacy": "^1.
|
|
73
|
+
"@graphql-markdown/printer-legacy": "^1.10.0",
|
|
74
74
|
"graphql-config": "^5.1.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@graphql-markdown/types": "^1.
|
|
77
|
+
"@graphql-markdown/types": "^1.5.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
80
|
"@graphql-markdown/printer-legacy": {
|