@docusaurus/plugin-content-docs 0.0.0-4700 → 0.0.0-4702

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.
@@ -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
- const sidebarsConfig = await loadSidebarsFileUnsafe(sidebarFilePath);
82
- const normalizedSidebars = (0, normalization_1.normalizeSidebars)(sidebarsConfig);
83
- (0, validation_1.validateSidebars)(normalizedSidebars);
84
- const categoriesMetadata = await readCategoriesMetadata(options.version.contentPath);
85
- const processedSidebars = await (0, processor_1.processSidebars)(normalizedSidebars, categoriesMetadata, options);
86
- return (0, postProcessor_1.postProcessSidebars)(processedSidebars, options);
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-4700",
3
+ "version": "0.0.0-4702",
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-4700",
27
- "@docusaurus/logger": "0.0.0-4700",
28
- "@docusaurus/mdx-loader": "0.0.0-4700",
29
- "@docusaurus/utils": "0.0.0-4700",
30
- "@docusaurus/utils-validation": "0.0.0-4700",
26
+ "@docusaurus/core": "0.0.0-4702",
27
+ "@docusaurus/logger": "0.0.0-4702",
28
+ "@docusaurus/mdx-loader": "0.0.0-4702",
29
+ "@docusaurus/utils": "0.0.0-4702",
30
+ "@docusaurus/utils-validation": "0.0.0-4702",
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-4700",
43
- "@docusaurus/types": "0.0.0-4700",
42
+ "@docusaurus/module-type-aliases": "0.0.0-4702",
43
+ "@docusaurus/types": "0.0.0-4702",
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": "746ec30e7642345d8238c307a28c877cd9499c52"
59
+ "gitHead": "c197646cc802977733f0110c1367de93906e8c78"
60
60
  }
@@ -98,16 +98,23 @@ export async function loadSidebars(
98
98
  sidebarFilePath: string | false | undefined,
99
99
  options: SidebarProcessorParams,
100
100
  ): Promise<Sidebars> {
101
- const sidebarsConfig = await loadSidebarsFileUnsafe(sidebarFilePath);
102
- const normalizedSidebars = normalizeSidebars(sidebarsConfig);
103
- validateSidebars(normalizedSidebars);
104
- const categoriesMetadata = await readCategoriesMetadata(
105
- options.version.contentPath,
106
- );
107
- const processedSidebars = await processSidebars(
108
- normalizedSidebars,
109
- categoriesMetadata,
110
- options,
111
- );
112
- return postProcessSidebars(processedSidebars, options);
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
  }