@graphql-markdown/docusaurus 1.30.3 → 1.31.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/index.d.ts CHANGED
@@ -4,3 +4,4 @@ import type { GraphQLMarkdownCliOptions } from "@graphql-markdown/types";
4
4
  *
5
5
  */
6
6
  export default function pluginGraphQLDocGenerator(_: LoadContext, options: GraphQLMarkdownCliOptions & Partial<PluginOptions>): Promise<Plugin>;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAczE;;GAEG;AACH,wBAA8B,yBAAyB,CACrD,CAAC,EAAE,WAAW,EACd,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC,GAC1D,OAAO,CAAC,MAAM,CAAC,CAyCjB"}
@@ -2,5 +2,9 @@
2
2
  * @module mdx
3
3
  * This module provides utilities for generating MDX index files in Docusaurus format.
4
4
  */
5
- import type { GenerateIndexMetafileType } from "@graphql-markdown/types";
6
- export declare const generateIndexMetafile: GenerateIndexMetafileType;
5
+ export declare const beforeGenerateIndexMetafileHook: (event: {
6
+ dirPath: string;
7
+ category: string;
8
+ options?: Record<string, unknown> | undefined;
9
+ }) => Promise<void>;
10
+ //# sourceMappingURL=category.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category.d.ts","sourceRoot":"","sources":["../../src/mdx/category.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,eAAO,MAAM,+BAA+B;;;;mBA+B3C,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * This module provides utilities for generating MDX index files in Docusaurus format.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.generateIndexMetafile = void 0;
7
+ exports.beforeGenerateIndexMetafileHook = void 0;
8
8
  const node_path_1 = require("node:path");
9
9
  const utils_1 = require("@graphql-markdown/utils");
10
10
  const CATEGORY_YAML = "_category_.yml";
@@ -13,15 +13,18 @@ var SidebarPosition;
13
13
  SidebarPosition[SidebarPosition["FIRST"] = 1] = "FIRST";
14
14
  SidebarPosition[SidebarPosition["LAST"] = 999] = "LAST";
15
15
  })(SidebarPosition || (SidebarPosition = {}));
16
- const generateIndexMetafile = async (dirPath, category, options) => {
16
+ const beforeGenerateIndexMetafileHook = async (event) => {
17
+ const { dirPath, category, options } = event;
17
18
  const filePath = (0, node_path_1.join)(dirPath, CATEGORY_YAML);
18
19
  if (await (0, utils_1.fileExists)(filePath)) {
19
20
  return;
20
21
  }
21
22
  const label = (0, utils_1.startCase)(category);
22
- const link = options?.index !== true
23
- ? "null"
24
- : `\n type: generated-index\n title: '${label} overview'`;
23
+ // Docusaurus 3.x uses the directory name as the id automatically
24
+ // No need to explicitly set id field in _category_.yml
25
+ const link = options?.index === true
26
+ ? `\n type: generated-index\n title: '${label} overview'`
27
+ : "null";
25
28
  const className = typeof options?.styleClass === "string"
26
29
  ? `className: ${options.styleClass}\n`
27
30
  : "";
@@ -32,4 +35,4 @@ const generateIndexMetafile = async (dirPath, category, options) => {
32
35
  await (0, utils_1.ensureDir)(dirPath);
33
36
  await (0, utils_1.saveFile)(filePath, content);
34
37
  };
35
- exports.generateIndexMetafile = generateIndexMetafile;
38
+ exports.beforeGenerateIndexMetafileHook = beforeGenerateIndexMetafileHook;
@@ -4,3 +4,4 @@
4
4
  */
5
5
  import type { MDXString } from "@graphql-markdown/types";
6
6
  export declare const mdxDeclaration: MDXString;
7
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/mdx/components.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,eAAO,MAAM,cAAc,EAAE,SA4Bf,CAAC"}
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import type { AdmonitionType, Badge, CollapsibleOption, Maybe, MDXString, MetaOptions, TypeLink } from "@graphql-markdown/types";
10
10
  export { mdxDeclaration } from "./components";
11
- export { generateIndexMetafile } from "./category";
11
+ export { beforeGenerateIndexMetafileHook } from "./category";
12
12
  export declare const formatMDXBadge: ({ text, classname }: Badge) => MDXString;
13
13
  /**
14
14
  * Formats an admonition block in MDX format
@@ -43,3 +43,4 @@ export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
43
43
  */
44
44
  export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
45
45
  export declare const formatMDXLink: ({ text, url }: TypeLink) => TypeLink;
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,WAAW,EACX,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAE7D,eAAO,MAAM,cAAc,2CAI1B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,gFAU/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,8BAE3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,4DAK5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,4BAEpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,yDAM/B,CAAC;AAEF,eAAO,MAAM,aAAa,uCAKzB,CAAC"}
package/dist/mdx/index.js CHANGED
@@ -8,16 +8,16 @@
8
8
  * @primaryExport
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.formatMDXLink = exports.formatMDXNameEntity = exports.formatMDXSpecifiedByLink = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.generateIndexMetafile = exports.mdxDeclaration = void 0;
11
+ exports.formatMDXLink = exports.formatMDXNameEntity = exports.formatMDXSpecifiedByLink = exports.formatMDXDetails = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.beforeGenerateIndexMetafileHook = exports.mdxDeclaration = void 0;
12
12
  const utils_1 = require("@graphql-markdown/utils");
13
13
  const MARKDOWN_EOL = "\n";
14
14
  const MARKDOWN_EOP = `${MARKDOWN_EOL.repeat(2)}`;
15
15
  const LINK_MDX_EXTENSION = ".mdx";
16
16
  const DEFAULT_CSS_CLASSNAME = "badge--secondary";
17
- var components_1 = require("./components");
17
+ const components_1 = require("./components");
18
18
  Object.defineProperty(exports, "mdxDeclaration", { enumerable: true, get: function () { return components_1.mdxDeclaration; } });
19
- var category_1 = require("./category");
20
- Object.defineProperty(exports, "generateIndexMetafile", { enumerable: true, get: function () { return category_1.generateIndexMetafile; } });
19
+ const category_1 = require("./category");
20
+ Object.defineProperty(exports, "beforeGenerateIndexMetafileHook", { enumerable: true, get: function () { return category_1.beforeGenerateIndexMetafileHook; } });
21
21
  const formatMDXBadge = ({ text, classname }) => {
22
22
  const style = typeof classname === "string" ? `badge--${classname.toLowerCase()}` : "";
23
23
  return `<Badge class="badge ${DEFAULT_CSS_CLASSNAME} ${style}" text="${text}"/>`;
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.30.3",
8
+ "version": "1.31.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -58,34 +58,34 @@
58
58
  "./package.json": "./package.json"
59
59
  },
60
60
  "scripts": {
61
- "prepack": "pinst --disable",
62
- "postpack": "pinst --enable",
63
61
  "stryker": "stryker run",
64
- "clean": "rm -rf ./dist",
65
- "docs": "typedoc"
62
+ "clean": "tsgo --build --clean && rm -rf ./dist",
63
+ "docs": "typedoc",
64
+ "build": "tsgo --build"
66
65
  },
67
66
  "dependencies": {
68
- "@graphql-markdown/cli": "^0.4.3",
69
- "@graphql-markdown/logger": "^1.0.5",
70
- "@graphql-markdown/utils": "^1.9.0",
71
- "@docusaurus/utils": ">=3.2.0"
67
+ "@graphql-markdown/cli": "workspace:^",
68
+ "@graphql-markdown/logger": "workspace:^",
69
+ "@graphql-markdown/utils": "workspace:^",
70
+ "@docusaurus/utils": "catalog:docusaurus"
72
71
  },
73
72
  "devDependencies": {
74
- "@docusaurus/types": "^3.7.0",
75
- "@graphql-markdown/types": "^1.8.0"
73
+ "@docusaurus/types": "catalog:docusaurus",
74
+ "@graphql-markdown/types": "workspace:^"
76
75
  },
77
76
  "peerDependencies": {
78
- "@docusaurus/logger": "*"
77
+ "@docusaurus/logger": "catalog:docusaurus"
79
78
  },
80
79
  "directories": {
81
80
  "test": "tests"
82
81
  },
83
82
  "engines": {
84
- "node": ">=16.14"
83
+ "node": ">=20"
85
84
  },
86
85
  "publishConfig": {
87
86
  "directory": "dist",
88
- "access": "public"
87
+ "access": "public",
88
+ "scripts": {}
89
89
  },
90
90
  "typescript": {
91
91
  "definition": "dist/index.d.ts"