@docusaurus/core 0.0.0-5268 → 0.0.0-5273
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/preload.js +3 -1
- package/lib/commands/writeTranslations.js +11 -5
- package/package.json +10 -10
package/lib/client/preload.js
CHANGED
|
@@ -15,6 +15,8 @@ import { matchRoutes } from 'react-router-config';
|
|
|
15
15
|
* @returns Promise object represents whether pathname has been preloaded
|
|
16
16
|
*/
|
|
17
17
|
export default function preload(pathname) {
|
|
18
|
-
const matches =
|
|
18
|
+
const matches = Array.from(new Set([pathname, decodeURI(pathname)]))
|
|
19
|
+
.map((p) => matchRoutes(routes, p))
|
|
20
|
+
.flat();
|
|
19
21
|
return Promise.all(matches.map((match) => match.route.component.preload?.()));
|
|
20
22
|
}
|
|
@@ -15,6 +15,14 @@ const init_1 = require("../server/plugins/init");
|
|
|
15
15
|
const translations_1 = require("../server/translations/translations");
|
|
16
16
|
const translationsExtractor_1 = require("../server/translations/translationsExtractor");
|
|
17
17
|
const utils_1 = require("../webpack/utils");
|
|
18
|
+
function resolveThemeCommonLibDir() {
|
|
19
|
+
try {
|
|
20
|
+
return path_1.default.dirname(require.resolve('@docusaurus/theme-common'));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
18
26
|
/**
|
|
19
27
|
* This is a hack, so that @docusaurus/theme-common translations are extracted!
|
|
20
28
|
* A theme doesn't have a way to express that one of its dependency (like
|
|
@@ -23,13 +31,11 @@ const utils_1 = require("../webpack/utils");
|
|
|
23
31
|
* We just make an exception and assume that user is using an official theme
|
|
24
32
|
*/
|
|
25
33
|
async function getExtraSourceCodeFilePaths() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return (0, translationsExtractor_1.globSourceCodeFilePaths)([themeCommonSourceDir]);
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
34
|
+
const themeCommonLibDir = resolveThemeCommonLibDir();
|
|
35
|
+
if (!themeCommonLibDir) {
|
|
31
36
|
return []; // User may not use a Docusaurus official theme? Quite unlikely...
|
|
32
37
|
}
|
|
38
|
+
return (0, translationsExtractor_1.globSourceCodeFilePaths)([themeCommonLibDir]);
|
|
33
39
|
}
|
|
34
40
|
async function writePluginTranslationFiles({ localizationDir, plugin, options, }) {
|
|
35
41
|
if (plugin.getTranslationFiles) {
|
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-5273",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@babel/runtime": "^7.18.9",
|
|
44
44
|
"@babel/runtime-corejs3": "^7.18.9",
|
|
45
45
|
"@babel/traverse": "^7.18.10",
|
|
46
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
47
|
-
"@docusaurus/logger": "0.0.0-
|
|
48
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
46
|
+
"@docusaurus/cssnano-preset": "0.0.0-5273",
|
|
47
|
+
"@docusaurus/logger": "0.0.0-5273",
|
|
48
|
+
"@docusaurus/mdx-loader": "0.0.0-5273",
|
|
49
49
|
"@docusaurus/react-loadable": "5.5.2",
|
|
50
|
-
"@docusaurus/utils": "0.0.0-
|
|
51
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
52
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
50
|
+
"@docusaurus/utils": "0.0.0-5273",
|
|
51
|
+
"@docusaurus/utils-common": "0.0.0-5273",
|
|
52
|
+
"@docusaurus/utils-validation": "0.0.0-5273",
|
|
53
53
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.7",
|
|
54
54
|
"@svgr/webpack": "^6.3.1",
|
|
55
55
|
"autoprefixer": "^10.4.8",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"webpackbar": "^5.0.2"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
110
|
-
"@docusaurus/types": "0.0.0-
|
|
109
|
+
"@docusaurus/module-type-aliases": "0.0.0-5273",
|
|
110
|
+
"@docusaurus/types": "0.0.0-5273",
|
|
111
111
|
"@types/detect-port": "^1.3.2",
|
|
112
112
|
"@types/react-dom": "^18.0.6",
|
|
113
113
|
"@types/react-router-config": "^5.0.6",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"engines": {
|
|
128
128
|
"node": ">=16.14"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "4687ad21af8c136d492fc1416432d6f1550c2225"
|
|
131
131
|
}
|