@docusaurus/core 0.0.0-6058 → 0.0.0-6060
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.
|
@@ -136,7 +136,7 @@ async function loadPlugins(context) {
|
|
|
136
136
|
return utils_1.PerfLogger.async('Load plugins', async () => {
|
|
137
137
|
const initializedPlugins = await utils_1.PerfLogger.async('Init plugins', () => (0, init_1.initPlugins)(context));
|
|
138
138
|
// TODO probably not the ideal place to hardcode those plugins
|
|
139
|
-
initializedPlugins.push((0, synthetic_1.createBootstrapPlugin)(context), (0, synthetic_1.createMDXFallbackPlugin)(context));
|
|
139
|
+
initializedPlugins.push((0, synthetic_1.createBootstrapPlugin)(context), await (0, synthetic_1.createMDXFallbackPlugin)(context));
|
|
140
140
|
const plugins = await executeAllPluginsContentLoading({
|
|
141
141
|
plugins: initializedPlugins,
|
|
142
142
|
context,
|
|
@@ -17,4 +17,4 @@ export declare function createBootstrapPlugin({ siteDir, siteConfig, }: LoadCont
|
|
|
17
17
|
* content plugins. This allows to do things such as importing repo/README.md as
|
|
18
18
|
* a partial from another doc. Not ideal solution, but good enough for now
|
|
19
19
|
*/
|
|
20
|
-
export declare function createMDXFallbackPlugin({ siteDir, siteConfig, }: LoadContext): InitializedPlugin
|
|
20
|
+
export declare function createMDXFallbackPlugin({ siteDir, siteConfig, }: LoadContext): Promise<InitializedPlugin>;
|
|
@@ -10,6 +10,7 @@ exports.createBootstrapPlugin = createBootstrapPlugin;
|
|
|
10
10
|
exports.createMDXFallbackPlugin = createMDXFallbackPlugin;
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
12
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
|
+
const mdx_loader_1 = require("@docusaurus/mdx-loader");
|
|
13
14
|
/**
|
|
14
15
|
* Make a synthetic plugin to:
|
|
15
16
|
* - Inject site client modules
|
|
@@ -57,7 +58,17 @@ function createBootstrapPlugin({ siteDir, siteConfig, }) {
|
|
|
57
58
|
* content plugins. This allows to do things such as importing repo/README.md as
|
|
58
59
|
* a partial from another doc. Not ideal solution, but good enough for now
|
|
59
60
|
*/
|
|
60
|
-
function createMDXFallbackPlugin({ siteDir, siteConfig, }) {
|
|
61
|
+
async function createMDXFallbackPlugin({ siteDir, siteConfig, }) {
|
|
62
|
+
const mdxLoaderItem = await (0, mdx_loader_1.createMDXLoaderItem)({
|
|
63
|
+
admonitions: true,
|
|
64
|
+
staticDirs: siteConfig.staticDirectories.map((dir) => path_1.default.resolve(siteDir, dir)),
|
|
65
|
+
siteDir,
|
|
66
|
+
// External MDX files are always meant to be imported as partials
|
|
67
|
+
isMDXPartial: () => true,
|
|
68
|
+
// External MDX files might have front matter, just disable the warning
|
|
69
|
+
isMDXPartialFrontMatterWarningDisabled: true,
|
|
70
|
+
markdownConfig: siteConfig.markdown,
|
|
71
|
+
});
|
|
61
72
|
return {
|
|
62
73
|
name: 'docusaurus-mdx-fallback-plugin',
|
|
63
74
|
options: {
|
|
@@ -77,28 +88,13 @@ function createMDXFallbackPlugin({ siteDir, siteConfig, }) {
|
|
|
77
88
|
return isMDXRule ? rule.include : [];
|
|
78
89
|
});
|
|
79
90
|
}
|
|
80
|
-
const mdxLoaderOptions = {
|
|
81
|
-
admonitions: true,
|
|
82
|
-
staticDirs: siteConfig.staticDirectories.map((dir) => path_1.default.resolve(siteDir, dir)),
|
|
83
|
-
siteDir,
|
|
84
|
-
// External MDX files are always meant to be imported as partials
|
|
85
|
-
isMDXPartial: () => true,
|
|
86
|
-
// External MDX files might have front matter, just disable the warning
|
|
87
|
-
isMDXPartialFrontMatterWarningDisabled: true,
|
|
88
|
-
markdownConfig: siteConfig.markdown,
|
|
89
|
-
};
|
|
90
91
|
return {
|
|
91
92
|
module: {
|
|
92
93
|
rules: [
|
|
93
94
|
{
|
|
94
95
|
test: /\.mdx?$/i,
|
|
95
96
|
exclude: getMDXFallbackExcludedPaths(),
|
|
96
|
-
use: [
|
|
97
|
-
{
|
|
98
|
-
loader: require.resolve('@docusaurus/mdx-loader'),
|
|
99
|
-
options: mdxLoaderOptions,
|
|
100
|
-
},
|
|
101
|
-
],
|
|
97
|
+
use: [mdxLoaderItem],
|
|
102
98
|
},
|
|
103
99
|
],
|
|
104
100
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/core",
|
|
3
3
|
"description": "Easy to Maintain Open Source Documentation Websites",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-6060",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"@babel/runtime": "^7.22.6",
|
|
44
44
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
45
45
|
"@babel/traverse": "^7.22.8",
|
|
46
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
47
|
-
"@docusaurus/logger": "0.0.0-
|
|
48
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
49
|
-
"@docusaurus/utils": "0.0.0-
|
|
50
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
51
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
46
|
+
"@docusaurus/cssnano-preset": "0.0.0-6060",
|
|
47
|
+
"@docusaurus/logger": "0.0.0-6060",
|
|
48
|
+
"@docusaurus/mdx-loader": "0.0.0-6060",
|
|
49
|
+
"@docusaurus/utils": "0.0.0-6060",
|
|
50
|
+
"@docusaurus/utils-common": "0.0.0-6060",
|
|
51
|
+
"@docusaurus/utils-validation": "0.0.0-6060",
|
|
52
52
|
"autoprefixer": "^10.4.14",
|
|
53
53
|
"babel-loader": "^9.1.3",
|
|
54
54
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"webpackbar": "^5.0.2"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
108
|
-
"@docusaurus/types": "0.0.0-
|
|
107
|
+
"@docusaurus/module-type-aliases": "0.0.0-6060",
|
|
108
|
+
"@docusaurus/types": "0.0.0-6060",
|
|
109
109
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
110
110
|
"@types/detect-port": "^1.3.3",
|
|
111
111
|
"@types/react-dom": "^18.2.7",
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"engines": {
|
|
133
133
|
"node": ">=18.0"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "75cf549134cde8901d2598e6c6d2439a334512ff"
|
|
136
136
|
}
|