@graphql-markdown/printer-legacy 1.8.3 → 1.8.4
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/const/strings.d.ts +5 -2
- package/dist/const/strings.js +10 -7
- package/dist/directive.js +1 -1
- package/dist/graphql/operation.d.ts +1 -1
- package/dist/link.js +1 -1
- package/dist/printer.d.ts +2 -2
- package/dist/section.js +5 -2
- package/package.json +4 -1
package/dist/const/strings.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { RootTypeLocale } from "@graphql-markdown/types";
|
|
2
2
|
export declare const ROOT_TYPE_LOCALE: RootTypeLocale;
|
|
3
|
+
export declare const LINK_MDX_EXTENSION: ".mdx";
|
|
4
|
+
export declare const DEPRECATED: "deprecated";
|
|
5
|
+
export declare const GRAPHQL: "graphql";
|
|
3
6
|
export declare const NO_DESCRIPTION_TEXT: "No description";
|
|
7
|
+
export declare const MARKDOWN_CODE_SNIPPET: "```";
|
|
4
8
|
export declare const FRONT_MATTER_DELIMITER: "---";
|
|
5
9
|
export declare const MARKDOWN_CODE_INDENTATION: " ";
|
|
6
10
|
export declare const MARKDOWN_EOL: "\n";
|
|
7
|
-
export declare const MARKDOWN_EOP:
|
|
11
|
+
export declare const MARKDOWN_EOP: string;
|
|
8
12
|
export declare const MARKDOWN_EOC: "\n```\n";
|
|
9
13
|
export declare const MARKDOWN_SOC: "\n```graphql\n";
|
|
10
|
-
export declare const DEPRECATED: "deprecated";
|
|
11
14
|
export declare const HIDE_DEPRECATED: "<><span className=\"deprecated\">Hide deprecated</span></>";
|
|
12
15
|
export declare const SHOW_DEPRECATED: "<><span className=\"deprecated\">Show deprecated</span></>";
|
package/dist/const/strings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SHOW_DEPRECATED = exports.HIDE_DEPRECATED = exports.
|
|
3
|
+
exports.SHOW_DEPRECATED = exports.HIDE_DEPRECATED = exports.MARKDOWN_SOC = exports.MARKDOWN_EOC = exports.MARKDOWN_EOP = exports.MARKDOWN_EOL = exports.MARKDOWN_CODE_INDENTATION = exports.FRONT_MATTER_DELIMITER = exports.MARKDOWN_CODE_SNIPPET = exports.NO_DESCRIPTION_TEXT = exports.GRAPHQL = exports.DEPRECATED = exports.LINK_MDX_EXTENSION = exports.ROOT_TYPE_LOCALE = void 0;
|
|
4
4
|
exports.ROOT_TYPE_LOCALE = {
|
|
5
5
|
DIRECTIVE: { singular: "directive", plural: "directives" },
|
|
6
6
|
ENUM: { singular: "enum", plural: "enums" },
|
|
@@ -14,13 +14,16 @@ exports.ROOT_TYPE_LOCALE = {
|
|
|
14
14
|
TYPE: { singular: "object", plural: "objects" },
|
|
15
15
|
UNION: { singular: "union", plural: "unions" },
|
|
16
16
|
};
|
|
17
|
+
exports.LINK_MDX_EXTENSION = ".mdx";
|
|
18
|
+
exports.DEPRECATED = "deprecated";
|
|
19
|
+
exports.GRAPHQL = "graphql";
|
|
17
20
|
exports.NO_DESCRIPTION_TEXT = "No description";
|
|
21
|
+
exports.MARKDOWN_CODE_SNIPPET = "```";
|
|
18
22
|
exports.FRONT_MATTER_DELIMITER = "---";
|
|
19
23
|
exports.MARKDOWN_CODE_INDENTATION = " ";
|
|
20
24
|
exports.MARKDOWN_EOL = "\n";
|
|
21
|
-
exports.MARKDOWN_EOP =
|
|
22
|
-
exports.MARKDOWN_EOC = `${exports.MARKDOWN_EOL}
|
|
23
|
-
exports.MARKDOWN_SOC = `${exports.MARKDOWN_EOL}
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.SHOW_DEPRECATED = `<><span className="deprecated">Show deprecated</span></>`;
|
|
25
|
+
exports.MARKDOWN_EOP = `${exports.MARKDOWN_EOL.repeat(2)}`;
|
|
26
|
+
exports.MARKDOWN_EOC = `${exports.MARKDOWN_EOL}${exports.MARKDOWN_CODE_SNIPPET}${exports.MARKDOWN_EOL}`;
|
|
27
|
+
exports.MARKDOWN_SOC = `${exports.MARKDOWN_EOL}${exports.MARKDOWN_CODE_SNIPPET}${exports.GRAPHQL}${exports.MARKDOWN_EOL}`;
|
|
28
|
+
exports.HIDE_DEPRECATED = `<><span className="${exports.DEPRECATED}">Hide ${exports.DEPRECATED}</span></>`;
|
|
29
|
+
exports.SHOW_DEPRECATED = `<><span className="${exports.DEPRECATED}">Show ${exports.DEPRECATED}</span></>`;
|
package/dist/directive.js
CHANGED
|
@@ -24,7 +24,7 @@ const printCustomDirective = (type, constDirectiveOption, options) => {
|
|
|
24
24
|
if (typeof description !== "string") {
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
27
|
-
return `${options_1.SectionLevels.LEVEL_4} ${typeNameLink}${strings_1.MARKDOWN_EOL}
|
|
27
|
+
return `${options_1.SectionLevels.LEVEL_4} ${typeNameLink}${strings_1.MARKDOWN_EOL} ${description}${strings_1.MARKDOWN_EOL} `;
|
|
28
28
|
};
|
|
29
29
|
exports.printCustomDirective = printCustomDirective;
|
|
30
30
|
const printCustomDirectives = (type, options) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PrintTypeOptions, MDXString } from "@graphql-markdown/types";
|
|
2
2
|
export declare const printOperationType: (type: unknown, options: PrintTypeOptions) => MDXString | string;
|
|
3
3
|
export declare const printOperationMetadata: (type: unknown, options: PrintTypeOptions) => MDXString | string;
|
|
4
|
-
export declare const printCodeOperation: (type: unknown, options?: PrintTypeOptions
|
|
4
|
+
export declare const printCodeOperation: (type: unknown, options?: PrintTypeOptions, indentationLevel?: number) => MDXString | string;
|
package/dist/link.js
CHANGED
|
@@ -88,7 +88,7 @@ const toLink = (type, name, operation, options) => {
|
|
|
88
88
|
? (0, group_1.getGroup)(type, options.groups, category)
|
|
89
89
|
: "";
|
|
90
90
|
const apiGroupFolder = options.useApiGroup ? (0, exports.getLinkApiGroupFolder)(type) : "";
|
|
91
|
-
const url = utils_1.pathUrl.join(options.basePath, deprecatedFolder, apiGroupFolder, groupFolder, category, (0, utils_1.slugify)(text));
|
|
91
|
+
const url = utils_1.pathUrl.join(options.basePath, deprecatedFolder, apiGroupFolder, groupFolder, category, `${(0, utils_1.slugify)(text)}${strings_1.LINK_MDX_EXTENSION}`);
|
|
92
92
|
return {
|
|
93
93
|
text,
|
|
94
94
|
url,
|
package/dist/printer.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CustomDirectiveMap, GraphQLDirective, GraphQLSchema, IPrinter, MDXString, Maybe, PrintTypeOptions, PrinterConfigPrintTypeOptions, SchemaEntitiesGroupMap, TypeDeprecatedOption } from "@graphql-markdown/types";
|
|
2
2
|
export declare class Printer implements IPrinter {
|
|
3
3
|
static options: Readonly<Maybe<PrintTypeOptions>>;
|
|
4
|
-
static readonly printDescription: (type: unknown, options?: PrintTypeOptions
|
|
4
|
+
static readonly printDescription: (type: unknown, options?: PrintTypeOptions, noText?: string) => MDXString | string;
|
|
5
5
|
static readonly printCustomDirectives: (type: unknown, options: PrintTypeOptions) => string;
|
|
6
|
-
static readonly printCustomTags: (type: unknown, options: PrintTypeOptions) =>
|
|
6
|
+
static readonly printCustomTags: (type: unknown, options: PrintTypeOptions) => MDXString | string;
|
|
7
7
|
static init(schema: Maybe<GraphQLSchema>, baseURL?: Maybe<string>, linkRoot?: Maybe<string>, { customDirectives, groups, onlyDocDirectives, printTypeOptions, skipDocDirectives, metatags, }?: {
|
|
8
8
|
customDirectives?: CustomDirectiveMap;
|
|
9
9
|
deprecated?: TypeDeprecatedOption;
|
package/dist/section.js
CHANGED
|
@@ -24,11 +24,14 @@ const printSectionItem = (type, options) => {
|
|
|
24
24
|
...options,
|
|
25
25
|
withAttributes: false,
|
|
26
26
|
});
|
|
27
|
-
const description = (0, common_1.printDescription)(type, options, "").replaceAll("\n", `${strings_1.MARKDOWN_EOL}> `);
|
|
28
27
|
const badges = (0, badge_1.printBadges)(type, options);
|
|
29
28
|
const tags = (0, directive_1.printCustomTags)(type, options);
|
|
30
29
|
const parentTypeLink = (0, link_1.printParentLink)(type, options);
|
|
31
|
-
|
|
30
|
+
const title = `${level} ${typeNameLink}${parentTypeLink} ${badges} ${tags}${strings_1.MARKDOWN_EOL}`;
|
|
31
|
+
const description = (0, common_1.printDescription)(type, options, "")
|
|
32
|
+
.trim()
|
|
33
|
+
.replaceAll("\n", `${strings_1.MARKDOWN_EOL}`);
|
|
34
|
+
let section = `${title}${description}${strings_1.MARKDOWN_EOL}`;
|
|
32
35
|
if ((0, graphql_1.isGraphQLFieldType)(type)) {
|
|
33
36
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
34
37
|
section += (0, exports.printSectionItems)(type.args, {
|
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.
|
|
8
|
+
"version": "1.8.4",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -63,6 +63,9 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@graphql-markdown/types": "^1.3.1"
|
|
65
65
|
},
|
|
66
|
+
"resolutions": {
|
|
67
|
+
"micromatch": "4.0.7"
|
|
68
|
+
},
|
|
66
69
|
"directories": {
|
|
67
70
|
"test": "tests"
|
|
68
71
|
},
|