@docusaurus/plugin-content-docs 0.0.0-4701 → 0.0.0-4707
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/sidebars/index.js +12 -6
- package/package.json +9 -9
- package/src/sidebars/index.ts +19 -12
package/lib/sidebars/index.js
CHANGED
|
@@ -78,11 +78,17 @@ async function loadSidebarsFileUnsafe(sidebarFilePath) {
|
|
|
78
78
|
exports.loadSidebarsFileUnsafe = loadSidebarsFileUnsafe;
|
|
79
79
|
// Note: sidebarFilePath must be absolute, use resolveSidebarPathOption
|
|
80
80
|
async function loadSidebars(sidebarFilePath, options) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
try {
|
|
82
|
+
const sidebarsConfig = await loadSidebarsFileUnsafe(sidebarFilePath);
|
|
83
|
+
const normalizedSidebars = (0, normalization_1.normalizeSidebars)(sidebarsConfig);
|
|
84
|
+
(0, validation_1.validateSidebars)(normalizedSidebars);
|
|
85
|
+
const categoriesMetadata = await readCategoriesMetadata(options.version.contentPath);
|
|
86
|
+
const processedSidebars = await (0, processor_1.processSidebars)(normalizedSidebars, categoriesMetadata, options);
|
|
87
|
+
return (0, postProcessor_1.postProcessSidebars)(processedSidebars, options);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
logger_1.default.error `Sidebars file at path=${sidebarFilePath} failed to be loaded.`;
|
|
91
|
+
throw err;
|
|
92
|
+
}
|
|
87
93
|
}
|
|
88
94
|
exports.loadSidebars = loadSidebars;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-docs",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4707",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@docusaurus/core": "0.0.0-
|
|
27
|
-
"@docusaurus/logger": "0.0.0-
|
|
28
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
29
|
-
"@docusaurus/utils": "0.0.0-
|
|
30
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
26
|
+
"@docusaurus/core": "0.0.0-4707",
|
|
27
|
+
"@docusaurus/logger": "0.0.0-4707",
|
|
28
|
+
"@docusaurus/mdx-loader": "0.0.0-4707",
|
|
29
|
+
"@docusaurus/utils": "0.0.0-4707",
|
|
30
|
+
"@docusaurus/utils-validation": "0.0.0-4707",
|
|
31
31
|
"combine-promises": "^1.1.0",
|
|
32
32
|
"fs-extra": "^10.0.1",
|
|
33
33
|
"import-fresh": "^3.3.0",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"webpack": "^5.70.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
43
|
-
"@docusaurus/types": "0.0.0-
|
|
42
|
+
"@docusaurus/module-type-aliases": "0.0.0-4707",
|
|
43
|
+
"@docusaurus/types": "0.0.0-4707",
|
|
44
44
|
"@types/js-yaml": "^4.0.5",
|
|
45
45
|
"@types/picomatch": "^2.3.0",
|
|
46
46
|
"commander": "^5.1.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=14"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "0092bf6871799bbc934553842aafd69768517768"
|
|
60
60
|
}
|
package/src/sidebars/index.ts
CHANGED
|
@@ -98,16 +98,23 @@ export async function loadSidebars(
|
|
|
98
98
|
sidebarFilePath: string | false | undefined,
|
|
99
99
|
options: SidebarProcessorParams,
|
|
100
100
|
): Promise<Sidebars> {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
101
|
+
try {
|
|
102
|
+
const sidebarsConfig = await loadSidebarsFileUnsafe(sidebarFilePath);
|
|
103
|
+
const normalizedSidebars = normalizeSidebars(sidebarsConfig);
|
|
104
|
+
validateSidebars(normalizedSidebars);
|
|
105
|
+
const categoriesMetadata = await readCategoriesMetadata(
|
|
106
|
+
options.version.contentPath,
|
|
107
|
+
);
|
|
108
|
+
const processedSidebars = await processSidebars(
|
|
109
|
+
normalizedSidebars,
|
|
110
|
+
categoriesMetadata,
|
|
111
|
+
options,
|
|
112
|
+
);
|
|
113
|
+
return postProcessSidebars(processedSidebars, options);
|
|
114
|
+
} catch (err) {
|
|
115
|
+
logger.error`Sidebars file at path=${
|
|
116
|
+
sidebarFilePath as string
|
|
117
|
+
} failed to be loaded.`;
|
|
118
|
+
throw err;
|
|
119
|
+
}
|
|
113
120
|
}
|