@docusaurus/plugin-content-docs 0.0.0-5827 → 0.0.0-5830
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/client/index.js +10 -3
- package/package.json +9 -9
- package/src/client/index.ts +14 -4
package/lib/client/index.js
CHANGED
|
@@ -13,9 +13,16 @@ const StableEmptyObject = {};
|
|
|
13
13
|
// In blog-only mode, docs hooks are still used by the theme. We need a fail-
|
|
14
14
|
// safe fallback when the docs plugin is not in use
|
|
15
15
|
export const useAllDocsData = () => useAllPluginInstancesData('docusaurus-plugin-content-docs') ?? StableEmptyObject;
|
|
16
|
-
export const useDocsData = (pluginId) =>
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export const useDocsData = (pluginId) => {
|
|
17
|
+
try {
|
|
18
|
+
return usePluginData('docusaurus-plugin-content-docs', pluginId, {
|
|
19
|
+
failfast: true,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new Error(`You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled${pluginId === 'Default' ? '' : ` (pluginId=${pluginId}`}`, { cause: error });
|
|
24
|
+
}
|
|
25
|
+
};
|
|
19
26
|
// TODO this feature should be provided by docusaurus core
|
|
20
27
|
export function useActivePlugin(options = {}) {
|
|
21
28
|
const data = useAllDocsData();
|
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-5830",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@docusaurus/core": "0.0.0-
|
|
39
|
-
"@docusaurus/logger": "0.0.0-
|
|
40
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
41
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
42
|
-
"@docusaurus/types": "0.0.0-
|
|
43
|
-
"@docusaurus/utils": "0.0.0-
|
|
44
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
38
|
+
"@docusaurus/core": "0.0.0-5830",
|
|
39
|
+
"@docusaurus/logger": "0.0.0-5830",
|
|
40
|
+
"@docusaurus/mdx-loader": "0.0.0-5830",
|
|
41
|
+
"@docusaurus/module-type-aliases": "0.0.0-5830",
|
|
42
|
+
"@docusaurus/types": "0.0.0-5830",
|
|
43
|
+
"@docusaurus/utils": "0.0.0-5830",
|
|
44
|
+
"@docusaurus/utils-validation": "0.0.0-5830",
|
|
45
45
|
"@types/react-router-config": "^5.0.7",
|
|
46
46
|
"combine-promises": "^1.1.0",
|
|
47
47
|
"fs-extra": "^11.1.1",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=18.0"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "d91fb0e542851b726538cdad9965db757316003b"
|
|
69
69
|
}
|
package/src/client/index.ts
CHANGED
|
@@ -86,10 +86,20 @@ export const useAllDocsData = (): {[pluginId: string]: GlobalPluginData} =>
|
|
|
86
86
|
}
|
|
87
87
|
| undefined) ?? StableEmptyObject;
|
|
88
88
|
|
|
89
|
-
export const useDocsData = (pluginId: string | undefined): GlobalPluginData =>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
export const useDocsData = (pluginId: string | undefined): GlobalPluginData => {
|
|
90
|
+
try {
|
|
91
|
+
return usePluginData('docusaurus-plugin-content-docs', pluginId, {
|
|
92
|
+
failfast: true,
|
|
93
|
+
}) as GlobalPluginData;
|
|
94
|
+
} catch (error) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
`You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled${
|
|
97
|
+
pluginId === 'Default' ? '' : ` (pluginId=${pluginId}`
|
|
98
|
+
}`,
|
|
99
|
+
{cause: error as Error},
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
93
103
|
|
|
94
104
|
// TODO this feature should be provided by docusaurus core
|
|
95
105
|
export function useActivePlugin(
|