docusaurus-plugin-openapi-docs 0.0.0-493 → 0.0.0-496
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/lib/index.js +10 -7
- package/lib/sidebars/index.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +14 -8
- package/src/sidebars/index.ts +1 -1
package/lib/index.js
CHANGED
|
@@ -27,15 +27,18 @@ function getDocsPluginConfig(presetsPlugins, pluginId) {
|
|
|
27
27
|
// eslint-disable-next-line array-callback-return
|
|
28
28
|
const filteredConfig = presetsPlugins.filter((data) => {
|
|
29
29
|
// Search presets
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
// Search plugin-content-docs instances
|
|
34
|
-
if (data[0] === "@docusaurus/plugin-content-docs") {
|
|
35
|
-
const configPluginId = data[1].id ? data[1].id : "default";
|
|
36
|
-
if (configPluginId === pluginId) {
|
|
30
|
+
if (Array.isArray(data)) {
|
|
31
|
+
if (typeof data[0] === "string" && data[0].endsWith(pluginId)) {
|
|
37
32
|
return data[1];
|
|
38
33
|
}
|
|
34
|
+
// Search plugin-content-docs instances
|
|
35
|
+
if (typeof data[0] === "string" &&
|
|
36
|
+
data[0] === "@docusaurus/plugin-content-docs") {
|
|
37
|
+
const configPluginId = data[1].id ? data[1].id : "default";
|
|
38
|
+
if (configPluginId === pluginId) {
|
|
39
|
+
return data[1];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
43
|
})[0];
|
|
41
44
|
if (filteredConfig) {
|
package/lib/sidebars/index.js
CHANGED
|
@@ -74,7 +74,7 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
|
|
|
74
74
|
.map((tag) => {
|
|
75
75
|
var _a;
|
|
76
76
|
// Map info object to tag
|
|
77
|
-
const taggedInfoObject = intros.find((i) => i.tags ? i.tags.
|
|
77
|
+
const taggedInfoObject = intros.find((i) => i.tags ? i.tags.find((t) => t.name === tag) : undefined);
|
|
78
78
|
const tagObject = tags.flat().find((t) => {
|
|
79
79
|
var _a;
|
|
80
80
|
return (_a = tag === t.name) !== null && _a !== void 0 ? _a : {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-496",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "2fdc948f4a14af0d135b6c18fb7823f4a4f578a9"
|
|
72
72
|
}
|
package/src/index.ts
CHANGED
|
@@ -30,18 +30,24 @@ export function getDocsPluginConfig(
|
|
|
30
30
|
// eslint-disable-next-line array-callback-return
|
|
31
31
|
const filteredConfig = presetsPlugins.filter((data) => {
|
|
32
32
|
// Search presets
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Search plugin-content-docs instances
|
|
38
|
-
if (data[0] === "@docusaurus/plugin-content-docs") {
|
|
39
|
-
const configPluginId = data[1].id ? data[1].id : "default";
|
|
40
|
-
if (configPluginId === pluginId) {
|
|
33
|
+
if (Array.isArray(data)) {
|
|
34
|
+
if (typeof data[0] === "string" && data[0].endsWith(pluginId)) {
|
|
41
35
|
return data[1];
|
|
42
36
|
}
|
|
37
|
+
|
|
38
|
+
// Search plugin-content-docs instances
|
|
39
|
+
if (
|
|
40
|
+
typeof data[0] === "string" &&
|
|
41
|
+
data[0] === "@docusaurus/plugin-content-docs"
|
|
42
|
+
) {
|
|
43
|
+
const configPluginId = data[1].id ? data[1].id : "default";
|
|
44
|
+
if (configPluginId === pluginId) {
|
|
45
|
+
return data[1];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
43
48
|
}
|
|
44
49
|
})[0];
|
|
50
|
+
|
|
45
51
|
if (filteredConfig) {
|
|
46
52
|
// Search presets, e.g. "classic"
|
|
47
53
|
if (filteredConfig[0].endsWith(pluginId)) {
|
package/src/sidebars/index.ts
CHANGED
|
@@ -110,7 +110,7 @@ function groupByTags(
|
|
|
110
110
|
.map((tag) => {
|
|
111
111
|
// Map info object to tag
|
|
112
112
|
const taggedInfoObject = intros.find((i) =>
|
|
113
|
-
i.tags ? i.tags.
|
|
113
|
+
i.tags ? i.tags.find((t: any) => t.name === tag) : undefined
|
|
114
114
|
);
|
|
115
115
|
const tagObject = tags.flat().find(
|
|
116
116
|
(t) =>
|